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 augroup END
]], false) ]], false)
end end
local msg = string.format('Language server %s started!' , client.name)
vim.api.nvim_echo({{msg, 'MoreMsg'}, }, false, {})
end end
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
@ -377,6 +380,7 @@ lspconfig.pyls.setup {
} }
-- set up ccls, see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#ccls -- set up ccls, see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#ccls
if vim.fn.executable('ccls') then
lspconfig.ccls.setup { lspconfig.ccls.setup {
on_attach = on_attach, on_attach = on_attach,
root_dir = lspconfig.util.root_pattern("compile_commands.json", ".ccls", ".git"), root_dir = lspconfig.util.root_pattern("compile_commands.json", ".ccls", ".git"),
@ -384,6 +388,7 @@ lspconfig.ccls.setup {
highlight = { lsRanges = true } highlight = { lsRanges = true }
} }
} }
end
-- set up vim-language-server -- set up vim-language-server
lspconfig.vimls.setup{ on_attach = on_attach } lspconfig.vimls.setup{ on_attach = on_attach }