From 13db25f74de21d019ee813ae6b7ac5c02b64fb97 Mon Sep 17 00:00:00 2001 From: Patrick Neff Date: Wed, 7 Aug 2024 11:04:14 +0200 Subject: [PATCH] fix commandline cmp select on tab --- modules/nixvim/plugins/lsp/cmp.nix | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/modules/nixvim/plugins/lsp/cmp.nix b/modules/nixvim/plugins/lsp/cmp.nix index 4a985c9..57bc6f8 100644 --- a/modules/nixvim/plugins/lsp/cmp.nix +++ b/modules/nixvim/plugins/lsp/cmp.nix @@ -10,7 +10,7 @@ store_selection_keys = ""; }; fromLua = [ - {paths = ../../snippets;} + { paths = ../../snippets; } ]; }; lspkind = { @@ -69,14 +69,14 @@ ''; completion.completeopt = "menu,preview"; sources = [ - {name = "luasnip";} - {name = "nvim_lsp";} - {name = "nvim_lsp_signature_help";} - {name = "nvim_lsp_document_symbol";} - {name = "codeium";} - {name = "path";} - {name = "buffer";} - {name = "treesitter";} + { name = "luasnip"; } + { name = "nvim_lsp"; } + { name = "nvim_lsp_signature_help"; } + { name = "nvim_lsp_document_symbol"; } + { name = "codeium"; } + { name = "path"; } + { name = "buffer"; } + { name = "treesitter"; } ]; mapping = { __raw = '' @@ -201,6 +201,14 @@ ]; }; ":" = { + completion.completeopt = "menu,menuone,noselect"; + mapping = { + __raw = '' + cmp.mapping.preset.cmdline({ + [""] = cmp.mapping.confirm { select = true }, + }) + ''; + }; sources = [ { name = "path"; @@ -212,7 +220,7 @@ }; "?" = { mapping = { - completion.completeopt = "menuone,noselect"; + completion.completeopt = "menu,menuone,noselect"; __raw = "cmp.mapping.preset.cmdline({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4),