diff options
Diffstat (limited to 'lua/lsp')
| -rw-r--r-- | lua/lsp/efm-general-ls.lua | 19 | 
1 files changed, 16 insertions, 3 deletions
| diff --git a/lua/lsp/efm-general-ls.lua b/lua/lsp/efm-general-ls.lua index faac9f4d..f9eac7ac 100644 --- a/lua/lsp/efm-general-ls.lua +++ b/lua/lsp/efm-general-ls.lua @@ -36,12 +36,25 @@ local shfmt = {    formatStdin = true  } +local markdownlint = { +    -- TODO default to global lintrc +    -- lintcommand = 'markdownlint -s -c ./markdownlintrc', +    lintCommand = 'markdownlint -s', +    lintStdin = true, +    lintFormats = { '%f:%l %m', '%f:%l:%c %m', '%f: %l: %m' } +} + +local markdownPandocFormat = { +  formatCommand = 'pandoc -f markdown -t gfm -sp --tab-stop=2', +  formatStdin = true +} +  require"lspconfig".efm.setup {      -- init_options = {initializationOptions},      init_options = {documentFormatting = true, codeAction = false}, -    filetypes = {"lua", "python", "javascriptreact", "javascript", "sh", "html", "css", "json", "yaml"}, +    filetypes = {"lua", "python", "javascriptreact", "javascript", "sh", "html", "css", "json", "yaml", "markdown"},      settings = {          rootMarkers = {".git/"},          languages = { @@ -54,11 +67,11 @@ require"lspconfig".efm.setup {              css = {prettier},              json = {prettier},              yaml = {prettier_yaml}, +            -- markdown = {markdownPandocFormat, markdownlint}, +            markdown = {markdownPandocFormat},          }      }  } --- TODO turn these eslint and prettier examples into something good --- TODO also shellcheck and shell formatting  -- Also find way to toggle format on save  -- maybe this will help: https://superuser.com/questions/439078/how-to-disable-autocmd-or-augroup-in-vim | 
