From 3892ebede32274a828bb408fa355818e00b885c9 Mon Sep 17 00:00:00 2001 From: Soispha Date: Thu, 24 Aug 2023 21:40:51 +0200 Subject: Fix(hm/conf/neovim/mappings): Add description to every mapping --- .../config/neovim/nixvim/mappings/default.nix | 96 +++++++++++++++++----- 1 file changed, 76 insertions(+), 20 deletions(-) (limited to 'home-manager/soispha/config/neovim') 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 - "y" = "\"+y"; - "Y" = "\"+Y"; + "y" = { + action = "\"+y"; + desc = "yank to the system clipboard"; + }; + "Y" = { + action = "\"+Y"; + desc = "yank until the end of the line to the system clipboard"; + }; # Unmap some old keys #"s" = "''"; @@ -56,23 +62,61 @@ "" = ""; # 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" = ""; - "t" = "g"; - "n" = "g"; - "s" = ""; + "h" = { + action = ""; + desc = "go left"; + }; + "t" = { + action = "g"; + desc = "go down, with displaylines"; + }; + "n" = { + action = "g"; + desc = "go up, with displaylines"; + }; + "s" = { + action = ""; + 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"; - "O" = "O"; + "o" = { + action = "o"; + desc = "add new line below"; + }; + "O" = { + action = "O"; + desc = "add new line above"; + }; "p" = { action = "\"_dP"; @@ -141,11 +191,11 @@ "" = { action = "mksession! "; - desc = "to overwrite/create a session"; + desc = "overwrite/create a session"; }; "X" = { - action = "[[!!$SHELL ]]"; + action = "!!$SHELL "; 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 '>+1gv=gv"; - "N" = ":m '<-2gv=gv"; + "T" = { + action = ":m '>+1gv=gv"; + desc = "move selected lines in visual mode down"; + }; + "N" = { + action = ":m '<-2gv=gv"; + desc = "move selected lines in visual mode up"; + }; }; }; }; -- cgit 1.4.1