diff --git a/lua/keybindings.lua b/lua/keybindings.lua index 2f16e77..db40fa6 100644 --- a/lua/keybindings.lua +++ b/lua/keybindings.lua @@ -66,19 +66,19 @@ local on_attach = function(client, bufnr) vim.keymap.set('n', 'F', function() vim.lsp.buf.format() end, opts) end -local cmp_mappings = function () - local cmp = require('cmp') - return { - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.scroll_docs(-4), +local cmp = require('cmp') +local cmp_select = {behavior = cmp.SelectBehavior.Select} +local cmp_mappings = { + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.select_prev_item(cmp_select), [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.confirm { + [''] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true, - }, + }), + [''] = cmp.mapping.abort(), } -end return { on_attach = on_attach, cmp_mappings = cmp_mappings }