about summary refs log tree commit diff stats
path: root/home-manager
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-24 21:40:51 +0200
committerSoispha <soispha@vhack.eu>2023-08-24 21:40:51 +0200
commit3892ebede32274a828bb408fa355818e00b885c9 (patch)
tree2640440c333ff75779371a826b9175e3e580efda /home-manager
parentFeat(hm/conf/neovim/plugins/which-key): Init (diff)
downloadnixos-config-3892ebede32274a828bb408fa355818e00b885c9.tar.gz
nixos-config-3892ebede32274a828bb408fa355818e00b885c9.zip
Fix(hm/conf/neovim/mappings): Add description to every mapping
Diffstat (limited to 'home-manager')
-rw-r--r--home-manager/soispha/config/neovim/nixvim/mappings/default.nix96
1 files changed, 76 insertions, 20 deletions
diff --git a/home-manager/soispha/config/neovim/nixvim/mappings/default.nix b/home-manager/soispha/config/neovim/nixvim/mappings/default.nix
index 11888e1e..1d00b0a4 100644
--- a/home-manager/soispha/config/neovim/nixvim/mappings/default.nix
+++ b/home-manager/soispha/config/neovim/nixvim/mappings/default.nix
@@ -44,8 +44,14 @@
         normal_and_insert;
       normalVisualOp = {
         # yank/ cut to the system clipboard
-        "<leader>y" = "\"+y";
-        "<leader>Y" = "\"+Y";
+        "<leader>y" = {
+          action = "\"+y";
+          desc = "yank to the system clipboard";
+        };
+        "<leader>Y" = {
+          action = "\"+Y";
+          desc = "yank until the end of the line to the system clipboard";
+        };
 
         # Unmap some old keys
         #"s" = "'<Nop>'";
@@ -56,23 +62,61 @@
         "<Right>" = "<Nop>";
 
         # Center the cursor vertically when moving to the next word during a search.
-        "l" = "nzzzv";
-        "L" = "Nzzzv";
+        "l" = {
+          action = "nzzzv";
+          desc = "Center the cursor vertically when moving to the next word during a
+          search.";
+        };
+        "L" = {
+          action = "Nzzzv";
+          desc = "Center the cursor vertically when moving to the next word during a
+          search.";
+        };
         # remap the other keys to dvorak
-        "k" = "t";
-        "K" = "T";
-        "j" = "k";
-        "J" = "K";
+        "k" = {
+          action = "t";
+          desc = "go the the right on char";
+        };
+        "K" = {
+          action = "T";
+          desc = "go to the left on char";
+        };
+        "j" = {
+          action = "k";
+          desc = "go to the right before the char";
+        };
+        "J" = {
+          action = "K";
+          desc = "go to the left before the char";
+        };
 
         # Change Vim-keys
-        "h" = "<left>";
-        "t" = "g<down>";
-        "n" = "g<up>";
-        "s" = "<right>";
+        "h" = {
+          action = "<left>";
+          desc = "go left";
+        };
+        "t" = {
+          action = "g<down>";
+          desc = "go down, with displaylines";
+        };
+        "n" = {
+          action = "g<up>";
+          desc = "go up, with displaylines";
+        };
+        "s" = {
+          action = "<right>";
+          desc = "go right";
+        };
 
         # Move display lines
-        "0" = "g0";
-        "$" = "g$";
+        "0" = {
+          action = "g0";
+          desc = "go to the leftmost character in the screen line";
+        };
+        "$" = {
+          action = "g$";
+          desc = "go to the rightmost character in the screen line";
+        };
       };
       normal =
         lib.recursiveUpdate {
@@ -106,8 +150,14 @@
           };
 
           # Exit insert mode after creating a new line above or below the current line.";
-          "o" = "o<Esc>";
-          "O" = "O<Esc>";
+          "o" = {
+            action = "o<Esc>";
+            desc = "add new line below";
+          };
+          "O" = {
+            action = "O<Esc>";
+            desc = "add new line above";
+          };
 
           "<leader>p" = {
             action = "\"_dP";
@@ -141,11 +191,11 @@
 
           "<C-s>" = {
             action = "<cmd>mksession! <CR>";
-            desc = "to overwrite/create a session";
+            desc = "overwrite/create a session";
           };
 
           "<leader>X" = {
-            action = "[[!!$SHELL <cr>]]";
+            action = "!!$SHELL <CR>";
             desc = "Read the current line and execute that line in your $SHELL. The resulting output will replace the curent line that was being executed.";
           };
         }
@@ -158,8 +208,14 @@
       };
       visual = {
         # move selected lines in visual mode
-        "T" = ":m '>+1<CR>gv=gv";
-        "N" = ":m '<-2<CR>gv=gv";
+        "T" = {
+          action = ":m '>+1<CR>gv=gv";
+          desc = "move selected lines in visual mode down";
+        };
+        "N" = {
+          action = ":m '<-2<CR>gv=gv";
+          desc = "move selected lines in visual mode up";
+        };
       };
     };
   };