From 3bfc56bf2a23ecb5139c74f91e50c7b328ddd650 Mon Sep 17 00:00:00 2001 From: cswimr Date: Sun, 2 Feb 2025 19:02:46 -0600 Subject: [PATCH] add mappings for `cmp` --- nixos/nvim/plugins/cmp.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/nixos/nvim/plugins/cmp.nix b/nixos/nvim/plugins/cmp.nix index 90b30fc..9b233d1 100644 --- a/nixos/nvim/plugins/cmp.nix +++ b/nixos/nvim/plugins/cmp.nix @@ -3,11 +3,22 @@ plugins = { cmp = { enable = true; - settings.sources = [ - { name = "nvim_lsp"; } - { name = "buffer"; } - { name = "path"; } - ]; + settings = { + sources = [ + { name = "nvim_lsp"; } + { name = "buffer"; } + { name = "path"; } + ]; + mapping = { + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.close()"; + "" = "cmp.mapping.scroll_docs(4)"; + "" = "cmp.mapping.confirm({ select = true })"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + }; + }; }; copilot-lua.enable = true; copilot-cmp.enable = true;