vim: start completion with <tab>

This commit is contained in:
Fernando Schauenburg 2023-07-13 21:15:13 +02:00
parent 19195f471e
commit ef2b80a534

View file

@ -38,8 +38,10 @@ local config = function()
keymap['<c-e>'] = cmp.mapping.abort() keymap['<c-e>'] = cmp.mapping.abort()
keymap['<c-y>'] = cmp.mapping.confirm { select = true } keymap['<c-y>'] = cmp.mapping.confirm { select = true }
keymap['<tab>'] = when(cmp.visible) { yes = cmp.mapping.confirm { select = true } } keymap['<tab>'] = when(cmp.visible) {
yes = cmp.mapping.confirm { select = true },
no = cmp.mapping.complete(),
}
cmp.setup { cmp.setup {
mapping = keymap, mapping = keymap,
@ -130,6 +132,7 @@ return {
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
config = config, config = config,
dependencies = { dependencies = {
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua', 'hrsh7th/cmp-nvim-lua',