summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorChris <[email protected]>2021-03-20 17:22:44 -0400
committerChris <[email protected]>2021-03-20 17:22:44 -0400
commit896f0e456c6e2f60dffc1d06009fefd90147208b (patch)
tree703862fd982f5fd74c0ee5f52abb31f39146669e /lua
parent0ae61fee049eba7d99df623631c5e2d0a0982f4d (diff)
update formatters
Diffstat (limited to 'lua')
-rw-r--r--lua/lsp/efm-general-ls.lua19
-rw-r--r--lua/nv-utils/init.lua6
2 files changed, 21 insertions, 4 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
diff --git a/lua/nv-utils/init.lua b/lua/nv-utils/init.lua
index 901a1a71..59388093 100644
--- a/lua/nv-utils/init.lua
+++ b/lua/nv-utils/init.lua
@@ -32,7 +32,11 @@ nv_utils.define_augroups({
{'FileType', 'java', 'luafile ~/.config/nvim/lua/lsp/java-ls.lua'},
{'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'},
{'FileType', 'java', 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'},
- {'FileType', 'markdown', 'set wrap'}
+ {'FileType', 'markdown', 'setlocal wrap'},
+ -- {'BufWinEnter', '.sol', 'setlocal filetype=solidity'},
+ {'BufRead', '*.sol', 'setlocal filetype=solidity'},
+ {'BufNewFile', '*.sol', 'setlocal filetype=solidity'}
+ -- autocmd! BufRead,BufNewFile *.{jsx,jx,js} setlocal filetype=javascript.jsx
-- {'User', 'GoyoLeave', 'lua require(\'galaxyline\').disable_galaxyline()'},
-- {'User', 'GoyoEnter', 'lua require(\'galaxyline\').galaxyline_augroup()'},
}