summary refs log tree commit diff stats
path: root/hm/nixvim
diff options
context:
space:
mode:
authorSilas Schöffel <sils@sils.li>2024-04-07 20:52:56 +0200
committerSilas Schöffel <sils@sils.li>2024-04-07 20:52:56 +0200
commit59974f833a3e3b706ba035e65b810d71e26ef40b (patch)
treee93532f92675dbde8c48e8ce43845fa9e792574c /hm/nixvim
parentnixvim: disable highlighting when pressing <Esc> (diff)
downloadnix-config-59974f833a3e3b706ba035e65b810d71e26ef40b.tar.gz
nix-config-59974f833a3e3b706ba035e65b810d71e26ef40b.zip
nixvim: add completion keymap
Diffstat (limited to 'hm/nixvim')
-rw-r--r--hm/nixvim/config.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/hm/nixvim/config.nix b/hm/nixvim/config.nix
index 99d003f..51ff108 100644
--- a/hm/nixvim/config.nix
+++ b/hm/nixvim/config.nix
@@ -55,6 +55,21 @@ pkgs: {
       key = "<Esc>";
       action = "<cmd>noh<CR><Esc>";
     }
+    {
+      mode = ["i"];
+      key = "<A-Space>";
+      action = ''
+        function()
+          local cmp = require('cmp');
+          local luasnip = require('luasnip');
+
+          if cmp.visible() then
+            cmp.select_next_item()
+          end
+        end
+      '';
+      lua = true;
+    }
   ];
   extraPlugins = with pkgs.vimPlugins; [
     vim-airline-themes