This commit is contained in:
Ray Elliott 2021-09-20 21:23:42 +01:00
parent d6a71c92d4
commit b12e317651
1 changed files with 10 additions and 11 deletions

View File

@ -56,12 +56,12 @@ local luaformat = {
}
local util = require "lspconfig".util
local on_attach_efm = function(client)
if client.resolved_capabilities.document_formatting then
vim.cmd [[augroup lsp_formatting]]
vim.cmd [[autocmd!]]
vim.cmd [[autocmd BufWritePre <buffer> :lua vim.lsp.buf.formatting_seq_sync({}, 1000)]]
vim.cmd [[augroup END]]
end
-- if client.resolved_capabilities.document_formatting then
-- vim.cmd [[augroup lsp_formatting]]
-- vim.cmd [[autocmd!]]
-- vim.cmd [[autocmd BufWritePre <buffer> :lua vim.lsp.buf.formatting_seq_sync({}, 1000)]]
-- vim.cmd [[augroup END]]
-- end
end
require "lspconfig".efm.setup {
init_options = {documentFormatting = true},
@ -75,10 +75,10 @@ require "lspconfig".efm.setup {
rootMarkers = {".eslintrc.js", ".git/"},
languages = {
javascript = {eslint},
json = {jq, fixjson},
python = {flake8, black},
sh = {shellcheck},
lua = {luaformat}
json = {jq, fixjson},
python = {flake8, black},
sh = {shellcheck},
lua = {luaformat}
}
}
}
@ -111,7 +111,6 @@ local servers = {
'vimls',
-- npm install -g vls
'vuels',
-- npm i -g stylelint-lsp
'yamlls',
}