about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--modules/home.legacy/conf/nvim/mappings/default.nix20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/home.legacy/conf/nvim/mappings/default.nix b/modules/home.legacy/conf/nvim/mappings/default.nix
index 40f1a377..d422abf7 100644
--- a/modules/home.legacy/conf/nvim/mappings/default.nix
+++ b/modules/home.legacy/conf/nvim/mappings/default.nix
@@ -215,6 +215,26 @@
         options.desc = "delete without saving to register";
       }
       {
+        key = "x";
+        mode = ["n"];
+        action.__raw = ''
+          function()
+            local col = vim.api.nvim_win_get_cursor(0)[2]
+            local char = vim.api.nvim_get_current_line():sub(col+1,col+1)
+            if char:match("%s") then
+              return '"_x'
+            else
+              return "x"
+            end
+          end
+        '';
+        options = {
+          desc = "Pipe all space only deletions to the blackhole register";
+          expr = true;
+          silent = true;
+        };
+      }
+      {
         key = "dd";
         mode = ["n"];
         action.__raw = ''