nvim: Add efm languageserver

Added a general purpose languageserver to round out the language server
possibilities. For now only configured to take care of bash linting
(using shellcheck) and formatting, but can be extended to a variety of
other languages (even helping more prosaic forms like markdown and pandoc).
This commit is contained in:
Marty Oehme 2021-08-18 23:10:50 +02:00
parent 176a4a233d
commit d0e083b6ab
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 28 additions and 0 deletions

View file

@ -34,6 +34,7 @@ docx2txt
duf duf
dunst dunst
dust dust
efm-langserver
entr entr
evince evince
exa exa
@ -214,6 +215,7 @@ vagrant
vi vi
vifm vifm
vim-language-server vim-language-server
vimiv
visidata visidata
xcape xcape
xclip xclip

View file

@ -111,6 +111,32 @@ end
-- set up simple servers -- set up simple servers
for _, lsp in ipairs(servers) do lspcfg[lsp].setup {on_attach = on_attach} end for _, lsp in ipairs(servers) do lspcfg[lsp].setup {on_attach = on_attach} end
lspcfg.efm.setup {
on_attach = on_attach,
init_options = {
documentFormatting = true,
codeAction = true,
completion = true,
documentSymbol = true,
hover = true
},
filetypes = {"sh"},
settings = {
rootMarkers = {".git/"},
languages = {
sh = {
{
lintCommand = 'shellcheck -f gcc -x',
lintFormats = {
'%f:%l:%c: %trror: %m', '%f:%l:%c: %tarning: %m',
'%f:%l:%c: %tote: %m'
}
}, {formatCommand = 'shfmt -ci -s -bn', formatStdin = true}
}
}
}
}
-- requires the lua-language-server package to be installed -- requires the lua-language-server package to be installed
-- The arch package defaults to the following directory -- The arch package defaults to the following directory
local sumneko_root_path = "/usr/share/lua-language-server" local sumneko_root_path = "/usr/share/lua-language-server"