diff options
Diffstat (limited to '.config/nvim/ftplugin/sh.lua')
-rw-r--r-- | .config/nvim/ftplugin/sh.lua | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/.config/nvim/ftplugin/sh.lua b/.config/nvim/ftplugin/sh.lua index e5f0a06..5110f6c 100644 --- a/.config/nvim/ftplugin/sh.lua +++ b/.config/nvim/ftplugin/sh.lua @@ -1,9 +1,11 @@ --- npm i -g bash-language-server -require("lspconfig").bashls.setup { - cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" }, - on_attach = require("cfg.lsp").common_on_attach, - filetypes = { "sh", "zsh" }, -} +if not require("cfg.utils").check_lsp_client_active "bashls" then + -- npm i -g bash-language-server + require("lspconfig").bashls.setup { + cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" }, + on_attach = require("cfg.lsp").common_on_attach, + filetypes = { "sh", "zsh" }, + } +end -- sh local sh_arguments = {} @@ -19,15 +21,17 @@ if O.lang.sh.linter == "shellcheck" then table.insert(sh_arguments, shellcheck) end -require("lspconfig").efm.setup { - -- init_options = {initializationOptions}, - cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, - init_options = { documentFormatting = true, codeAction = false }, - filetypes = { "sh" }, - settings = { - rootMarkers = { ".git/" }, - languages = { - sh = sh_arguments, +if not require("cfg.utils").check_lsp_client_active "efm" then + require("lspconfig").efm.setup { + -- init_options = {initializationOptions}, + cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, + init_options = { documentFormatting = true, codeAction = false }, + filetypes = { "sh" }, + settings = { + rootMarkers = { ".git/" }, + languages = { + sh = sh_arguments, + }, }, - }, -} + } +end |