Title here
Summary here
Language servers know what can complete at the cursor; a completion plugin
shows it. The classic pairing is
nvim-cmp with the
cmp-nvim-lsp source:
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'local cmp = require('cmp')
cmp.setup({
sources = { { name = 'nvim_lsp' } },
mapping = cmp.mapping.preset.insert({
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
})Type in a buffer with a server attached and candidates appear as you type — methods with signatures, module members, documentation alongside.
Two notes before you settle in:
require('cmp_nvim_lsp').default_capabilities() for exactly that.