From 88616bde7c7b5b25f505997aa2171245f7341453 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 8 Jul 2021 20:17:26 +0200 Subject: Updates to lang stuff --- .config/nvim/ftplugin/sh.lua | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to '.config/nvim/ftplugin/sh.lua') 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 -- cgit v1.2.3-70-g09d2