aboutsummaryrefslogtreecommitdiff
path: root/core/plugins.vim
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-04-09 23:40:52 +0800
committerjdhao <jdhao@hotmail.com>2021-04-09 23:40:52 +0800
commitaeea5f18f5e6d237ec608aaed60c850ab255ef5c (patch)
treebd9376f2c7bbe7ca5936bdb3ab5761ec6444070c /core/plugins.vim
parent82a97710c8d875ffa32db27acf051336cc84659d (diff)
update nvim-lsp config
Diffstat (limited to 'core/plugins.vim')
-rw-r--r--core/plugins.vim17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/plugins.vim b/core/plugins.vim
index e2e1809..75dafe5 100644
--- a/core/plugins.vim
+++ b/core/plugins.vim
@@ -356,6 +356,9 @@ local on_attach = function(client, bufnr)
augroup END
]], false)
end
+
+ local msg = string.format('Language server %s started!' , client.name)
+ vim.api.nvim_echo({{msg, 'MoreMsg'}, }, false, {})
end
local lspconfig = require("lspconfig")
@@ -377,13 +380,15 @@ lspconfig.pyls.setup {
}
-- set up ccls, see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#ccls
-lspconfig.ccls.setup {
- on_attach = on_attach,
- root_dir = lspconfig.util.root_pattern("compile_commands.json", ".ccls", ".git"),
- init_options = {
- highlight = { lsRanges = true }
+if vim.fn.executable('ccls') then
+ lspconfig.ccls.setup {
+ on_attach = on_attach,
+ root_dir = lspconfig.util.root_pattern("compile_commands.json", ".ccls", ".git"),
+ init_options = {
+ highlight = { lsRanges = true }
+ }
}
-}
+end
-- set up vim-language-server
lspconfig.vimls.setup{ on_attach = on_attach }