1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 06:40:05 +08:00
SpaceVim/bundle/cmp-nvim-lsp/README.md

25 lines
515 B
Markdown
Raw Normal View History

# cmp-nvim-lsp
nvim-cmp source for neovim builtin LSP client
# Setup
```lua
require'cmp'.setup {
sources = {
{ name = 'nvim_lsp' }
}
}
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- The following example advertise capabilities to `clangd`.
require'lspconfig'.clangd.setup {
capabilities = capabilities,
}
```