1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

update nvim-lsp config

This commit is contained in:
jdhao 2021-04-09 23:40:52 +08:00
parent 82a97710c8
commit aeea5f18f5

View File

@ -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 }