@@ -585,6 +585,7 @@ require('lazy').setup {
585
585
local ensure_installed = vim .tbl_keys (servers or {})
586
586
vim .list_extend (ensure_installed , {
587
587
' stylua' , -- Used to format lua code
588
+ ' markdownlint' , -- Used to lint markdown
588
589
})
589
590
require (' mason-tool-installer' ).setup { ensure_installed = ensure_installed }
590
591
@@ -623,6 +624,59 @@ require('lazy').setup {
623
624
},
624
625
},
625
626
627
+ { -- Linting
628
+ ' mfussenegger/nvim-lint' ,
629
+ event = { ' BufReadPre' , ' BufNewFile' },
630
+ config = function ()
631
+ local lint = require ' lint'
632
+ lint .linters_by_ft = {
633
+ markdown = { ' markdownlint' },
634
+ }
635
+
636
+ -- To allow other plugins to add linters to require('lint').linters_by_ft,
637
+ -- instead set linters_by_ft like this:
638
+ -- lint.linters_by_ft = lint.linters_by_ft or {}
639
+ -- lint.linters_by_ft['markdown'] = { 'markdownlint' }
640
+ --
641
+ -- However, note that this will enable a set of default linters,
642
+ -- which will cause errors unless these tools are available:
643
+ -- {
644
+ -- clojure = { "clj-kondo" },
645
+ -- dockerfile = { "hadolint" },
646
+ -- inko = { "inko" },
647
+ -- janet = { "janet" },
648
+ -- json = { "jsonlint" },
649
+ -- markdown = { "vale" },
650
+ -- rst = { "vale" },
651
+ -- ruby = { "ruby" },
652
+ -- terraform = { "tflint" },
653
+ -- text = { "vale" }
654
+ -- }
655
+ --
656
+ -- You can disable the default linters by setting their filetypes to nil:
657
+ -- lint.linters_by_ft['clojure'] = nil
658
+ -- lint.linters_by_ft['dockerfile'] = nil
659
+ -- lint.linters_by_ft['inko'] = nil
660
+ -- lint.linters_by_ft['janet'] = nil
661
+ -- lint.linters_by_ft['json'] = nil
662
+ -- lint.linters_by_ft['markdown'] = nil
663
+ -- lint.linters_by_ft['rst'] = nil
664
+ -- lint.linters_by_ft['ruby'] = nil
665
+ -- lint.linters_by_ft['terraform'] = nil
666
+ -- lint.linters_by_ft['text'] = nil
667
+
668
+ -- Create autocommand which carries out the actual linting
669
+ -- on the specified events.
670
+ local lint_augroup = vim .api .nvim_create_augroup (' lint' , { clear = true })
671
+ vim .api .nvim_create_autocmd ({ ' BufEnter' , ' BufWritePost' , ' InsertLeave' }, {
672
+ group = lint_augroup ,
673
+ callback = function ()
674
+ require (' lint' ).try_lint ()
675
+ end ,
676
+ })
677
+ end ,
678
+ },
679
+
626
680
{ -- Autocompletion
627
681
' hrsh7th/nvim-cmp' ,
628
682
event = ' InsertEnter' ,
0 commit comments