about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/nv/nvim/plgs/luasnip/default.nix56
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/by-name/nv/nvim/plgs/luasnip/default.nix b/modules/by-name/nv/nvim/plgs/luasnip/default.nix
index e7c006a6..8e445d40 100644
--- a/modules/by-name/nv/nvim/plgs/luasnip/default.nix
+++ b/modules/by-name/nv/nvim/plgs/luasnip/default.nix
@@ -16,6 +16,62 @@
   cfg = config.soispha.programs.nvim;
 in {
   home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
+    keymaps = [
+      {
+        key = "<C-K>";
+        mode = ["i"];
+        action.__raw = ''
+          function()
+            require('luasnip').expand()
+          end
+        '';
+        options = {
+          # silent = true;
+          desc = "Expand the snippet";
+        };
+      }
+      {
+        key = "<C-L>";
+        mode = ["i" "s"];
+        action.__raw = ''
+          function()
+            require('luasnip').jump(1)
+          end
+        '';
+        options = {
+          # silent = true;
+          desc = "Jump forward in snippet insert nodes";
+        };
+      }
+      {
+        key = "<C-J>";
+        mode = ["i" "s"];
+        action.__raw = ''
+          function()
+            require('luasnip').jump(-1)
+          end
+        '';
+        options = {
+          # silent = true;
+          desc = "Jump backwards in snippet insert nodes";
+        };
+      }
+      {
+        key = "<C-E>";
+        mode = ["i" "s"];
+        action.__raw = ''
+          function()
+            if require('luasnip').choice_active() then
+              require('luasnip').change_choice(1)
+            end
+          end
+        '';
+        options = {
+          # silent = true;
+          desc = "Cycle through the snippets choice nodes";
+        };
+      }
+    ];
     plugins.luasnip = {
       enable = true;