From c90437651c4125aebc49e0f1787f35af9634db90 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Wed, 18 Sep 2024 00:55:54 -0700 Subject: [PATCH] keys: add a ton of QoL keymappings --- config/keymaps.nix | 132 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 3 deletions(-) diff --git a/config/keymaps.nix b/config/keymaps.nix index b524b3f..ec5175e 100644 --- a/config/keymaps.nix +++ b/config/keymaps.nix @@ -23,6 +23,129 @@ desc = "Zen mode"; }; } + { + mode = "n"; + action = ""; + key = "zz"; + options = { + silent = true; + noremap = true; + desc = "Scroll down and center"; + }; + } + { + mode = "n"; + action = ":%%s/\\<\\>//gI"; + key = "fs"; + options = { + silent = true; + noremap = true; + desc = "Search and replace the word under the cursor globally and case-insensitively"; + }; + } + { + mode = "n"; + action = ""; + key = "zz"; + options = { + silent = true; + noremap = true; + desc = "Scroll up and center"; + }; + } + { + mode = "n"; + action = ":CellularAutomaton make_it_rain"; + key = "kys"; + options = { + silent = true; + noremap = true; + desc = "A mysterious surprise!"; + }; + } + { + mode = "n"; + action = "nzzzv"; + key = "n"; + options = { + silent = true; + noremap = true; + desc = "Search next and center screen, reopening folds"; + }; + } + { + mode = "n"; + action = "Nzzzv"; + key = "N"; + options = { + silent = true; + noremap = true; + desc = "Search previous and center screen, reopening folds"; + }; + } + # The greatest remap of all time -- the primeagen + { + mode = [ + "n" + "v" + ]; + action = "\"_d"; + key = "d"; + options = { + silent = true; + noremap = true; + desc = "Delete without copying to register"; + }; + } + { + mode = [ + "n" + "v" + ]; + action = "\"+y"; + key = "y"; + options = { + silent = true; + noremap = true; + desc = "Yank to system clipboard"; + }; + } + { + mode = "n"; + action = "\"+Y"; + key = "Y"; + options = { + silent = true; + noremap = true; + desc = "Yank whole line to system clipboard"; + }; + } + { + mode = [ + "n" + "v" + ]; + action = "\"+p"; + key = "p"; + options = { + silent = true; + noremap = true; + desc = "Put from system clipboard"; + }; + } + { + mode = [ + "n" + "v" + ]; + action = "\"+P"; + key = "P"; + options = { + silent = true; + noremap = true; + desc = "Put from system clipboard"; + }; + } { action = "Telescope find_files"; key = "ff"; @@ -485,9 +608,12 @@ } { action = ":Telescope yank_history"; - key = "p"; - mode = "n"; - options.desc = "Look through yank history with telescope."; + key = "fp"; + mode = [ + "n" + "v" + ]; + options.desc = "Search through yank history with telescope."; } { action = '':Oil'';