From 1edd7e0fa64cd3696889595d4b2d0d29e8ac51a2 Mon Sep 17 00:00:00 2001 From: Nick Zana Date: Mon, 24 Apr 2023 00:10:20 -0400 Subject: [PATCH] change completion keybindings --- lua/keybindings.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 }