From 249f05860fa1c19b809c1724c64776630d2ecf88 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Tue, 21 Nov 2023 16:16:40 +0000
Subject: [PATCH] feat(neovim): configure markdownlint

Prevent diagnostic messages for duplicate sibling headings and line
length.
---
 config/neovim/lua/opdavies/lsp/none-ls.lua | 2 +-
 system/shared/modules/neovim.nix           | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/config/neovim/lua/opdavies/lsp/none-ls.lua b/config/neovim/lua/opdavies/lsp/none-ls.lua
index daa3d137..706eaf68 100644
--- a/config/neovim/lua/opdavies/lsp/none-ls.lua
+++ b/config/neovim/lua/opdavies/lsp/none-ls.lua
@@ -29,7 +29,7 @@ null_ls.setup {
       end,
     },
     diagnostics.markdownlint.with {
-      extra_args = { "--disable", "MD013" },
+      extra_args = { "--config", "~/.markdownlint.yaml" },
     },
     diagnostics.php,
     diagnostics.phpcs.with {
diff --git a/system/shared/modules/neovim.nix b/system/shared/modules/neovim.nix
index 82c789ca..5c2b2cc8 100644
--- a/system/shared/modules/neovim.nix
+++ b/system/shared/modules/neovim.nix
@@ -243,4 +243,13 @@ in
       shellcheck
     ];
   };
+
+  home.file.".markdownlint.yaml".text = ''
+    default: true
+
+    line-length: false
+
+    no-duplicate-heading:
+      siblings_only: true
+  '';
 }