# cmp-nvim-lsp **Repository Path**: mirror_jedsek/cmp-nvim-lsp ## Basic Information - **Project Name**: cmp-nvim-lsp - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-04-04 - **Last Updated**: 2022-04-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cmp-nvim-lsp nvim-cmp source for neovim's built-in language server client. # Capabilities Language servers provide different completion results depending on the capabilities of the client. Neovim's default omnifunc has basic support for serving completion candidates. nvim-cmp supports more types of completion candidates, so users must override the capabilities sent to the server such that it can provide these candidates during a completion request. These capabilities are provided via the helper function `require('cmp_nvim_lsp').update_capabilities` As these candidates are sent on each request, **adding these capabilities will break the built-in omnifunc support for neovim's language server client**. `nvim-cmp` provides manually triggered completion that can replace omnifunc. See `:help cmp-faq` for more details. # 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, } ```