diff --git a/modules/nixvim/keymaps/default.nix b/modules/nixvim/keymaps/default.nix index 21f66ce..5237bc1 100644 --- a/modules/nixvim/keymaps/default.nix +++ b/modules/nixvim/keymaps/default.nix @@ -24,7 +24,7 @@ in { keymaps = # # Disable Arrow Key Movement - - - - - - - - - - - - - - - - - - - - - - - - - (map (d: keys.mk' ["i" "n"] d "") ["" "" "" ""]) + (map (d: keys.mk' ["i" "n"] d "") ["" "" "" ""]) # # Better Up/Down - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ ( @@ -51,7 +51,7 @@ in { then "+" else "-"; in - keys.mk ["n"] "" "resize ${s}4" "${d} Window Height" + keys.mk ["n"] "" "resize ${s}4" "${d} Window Height" ) { Up = "Increase"; @@ -68,23 +68,23 @@ in { # previous -> Prev prettyDir = (toUpper (substring 0 1 d)) + (substring 1 3 d); in - keys.mk ["n"] k "b${d}" "${prettyDir} Buffer" + keys.mk ["n"] k "b${d}" "${prettyDir} Buffer" ) { - "" = "previous"; - "" = "next"; + "" = "previous"; + "" = "next"; "[b" = "previous"; "]b" = "next"; } ) - ++ [(keys.mk ["n"] "bD" "bd" "Delete Buffer and Window")] + ++ [(keys.mk ["n"] "bD" "bd" "Delete Buffer and Window")] # # Clear Search/Diff Update/Redraw - - - - - - - - - - - - - - - - - - - - - ++ [ - (keys.mk ["i" "n"] "" "noh" "Escape and Clear hlsearch") + (keys.mk ["i" "n"] "" "noh" "Escape and Clear hlsearch") ( - keys.mk ["n"] "ur" - "nohlsearchdiffupdatenormal! " + keys.mk ["n"] "ur" + "nohlsearchdiffupdatenormal! " "Redraw / Clear hlsearch / Diff Update" ) ] @@ -119,11 +119,11 @@ in { ) # # Undo Break-Points - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ (map (c: keys.mk' ["i"] c "${c}u") ["," "." ";"]) + ++ (map (c: keys.mk' ["i"] c "${c}u") ["," "." ";"]) # # Search Docs (keywordprog) - - - - - - - - - - - - - - - - - - - - - - - - # https://til.codeinthehole.com/posts/about-how-to-use-keywordprg-effectively/ - ++ [(keys.mk ["n"] "K" "norm! K" "Search for word")] + ++ [(keys.mk ["n"] "K" "norm! K" "Search for word")] # # Better Indenting - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ (map (c: keys.mk' ["v"] c "${c}gv") ["<" ">"]) @@ -132,7 +132,7 @@ in { ++ ( mapAttrsToList ( k: d: - keys.mk ["n"] "gc${k}" "${k}Vcxnormal gccfxa" + keys.mk ["n"] "gc${k}" "${k}Vcxnormal gccfxa" "Add Comment ${d}" ) { @@ -142,19 +142,19 @@ in { ) # # New File - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ [(keys.mk ["n"] "fn" "enew" "New File")] + ++ [(keys.mk ["n"] "fn" "enew" "New File")] # # Locations/Quickfixes - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ [ - (keys.mk ["n"] "xl" "lopen" "Location List") - (keys.mk ["n"] "xq" "copen" "Quickfix list") + (keys.mk ["n"] "xl" "lopen" "Location List") + (keys.mk ["n"] "xq" "copen" "Quickfix list") ] ++ ( mapAttrsToList ( k: d: let cmd = substring 0 4 (toLower d); in - keys.mk ["n"] "${k}q" "c${cmd}" "${d} Quickfix" + keys.mk ["n"] "${k}q" "c${cmd}" "${d} Quickfix" ) { "[" = "Previous"; @@ -164,7 +164,7 @@ in { # # Diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ [ - (keys.mk ["n"] "cd" ( + (keys.mk ["n"] "cd" ( mkRaw # lua "function() vim.diagnostic.open_float() end" @@ -215,17 +215,17 @@ in { ) # # Quit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ [(keys.mk ["n"] "qq" "qa" "Quit All")] + ++ [(keys.mk ["n"] "qq" "qa" "Quit All")] # # Inspect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ [(keys.mk ["n"] "ui" (mkRaw "vim.show_pos") "Inspect Position")] + ++ [(keys.mk ["n"] "ui" (mkRaw "vim.show_pos") "Inspect Position")] # # Window Management - - - - - - - - - - - - - - - - - - - - - - - - - - - - ++ [ - (keys.mkWithOpts ["n"] "w" "" "Windows" {remap = true;}) - (keys.mkWithOpts ["n"] "-" "s" "Split Window Below" {remap = true;}) - (keys.mkWithOpts ["n"] "|" "v" "Split Window Right" {remap = true;}) - (keys.mkWithOpts ["n"] "wd" "c" "Delete Window" {remap = true;}) + (keys.mkWithOpts ["n"] "w" "" "Windows" {remap = true;}) + (keys.mkWithOpts ["n"] "-" "s" "Split Window Below" {remap = true;}) + (keys.mkWithOpts ["n"] "|" "v" "Split Window Right" {remap = true;}) + (keys.mkWithOpts ["n"] "wd" "c" "Delete Window" {remap = true;}) ] # # Tab Management - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -237,13 +237,13 @@ in { then "Close Other Tabs" else "${a} Tab"; in - keys.mk ["n"] "${k}" "tab${toLower a}" desc + keys.mk ["n"] "${k}" "tab${toLower a}" desc ) { l = "Last"; o = "Only"; f = "First"; - "" = "New"; + "" = "New"; "]" = "Next"; d = "Close"; "[" = "Previous"; diff --git a/modules/nixvim/plugins/util/snacks/default.nix b/modules/nixvim/plugins/util/snacks/default.nix index 6038dba..41bc962 100644 --- a/modules/nixvim/plugins/util/snacks/default.nix +++ b/modules/nixvim/plugins/util/snacks/default.nix @@ -22,57 +22,57 @@ in { }; keymaps = [ - (keys.mk ["n"] "un" ( + (keys.mk ["n"] "un" ( mkRaw # lua "function() Snacks.notifier.hide() end" ) "Dismiss All Notifications") - (keys.mk ["n"] "bd" ( + (keys.mk ["n"] "bd" ( mkRaw # lua "function() Snacks.bufdelete() end" ) "Delete Buffer") - (keys.mk ["n"] "bo" ( + (keys.mk ["n"] "bo" ( mkRaw # lua "function() Snacks.bufdelete.other() end" ) "Delete Other Buffers") # LazyGit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (keys.mk ["n"] "gg" ( + (keys.mk ["n"] "gg" ( mkRaw # lua "function() Snacks.lazygit() end" ) "Lazygit") - (keys.mk ["n"] "gf" ( + (keys.mk ["n"] "gf" ( mkRaw # lua "function() Snacks.lazygit.log_file() end" ) "Lazygit Current File History") - (keys.mk ["n"] "gl" ( + (keys.mk ["n"] "gl" ( mkRaw # lua "function() Snacks.lazygit.log() end" ) "Lazygit Log") # Git - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (keys.mk ["n"] "gb" ( + (keys.mk ["n"] "gb" ( mkRaw # lua "function() Snacks.git.blame_line() end" ) "Git Blame Line") - (keys.mk ["n" "x"] "gB" ( + (keys.mk ["n" "x"] "gB" ( mkRaw # lua "function() Snacks.gitbrowse() end" ) "Git Browse (open)") - (keys.mk ["n" "x"] "gY" (mkRaw + (keys.mk ["n" "x"] "gY" (mkRaw # lua '' function() @@ -131,19 +131,19 @@ in { }) end - toggle_format():map("uf") - toggle_format(true):map("uF") + toggle_format():map("uf") + toggle_format(true):map("uF") - Snacks.toggle.option("spell", { name = "Spelling"}):map("us") - Snacks.toggle.option("wrap", {name = "Wrap"}):map("uw") - Snacks.toggle.option("relativenumber", { name = "Relative Number"}):map("uL") - Snacks.toggle.diagnostics():map("ud") - Snacks.toggle.line_number():map("ul") - Snacks.toggle.option("conceallevel", {off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2}):map("uc") - Snacks.toggle.treesitter():map("uT") - Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background"}):map("ub") + Snacks.toggle.option("spell", { name = "Spelling"}):map("us") + Snacks.toggle.option("wrap", {name = "Wrap"}):map("uw") + Snacks.toggle.option("relativenumber", { name = "Relative Number"}):map("uL") + Snacks.toggle.diagnostics():map("ud") + Snacks.toggle.line_number():map("ul") + Snacks.toggle.option("conceallevel", {off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2}):map("uc") + Snacks.toggle.treesitter():map("uT") + Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background"}):map("ub") if vim.lsp.inlay_hint then - Snacks.toggle.inlay_hints():map("uh") + Snacks.toggle.inlay_hints():map("uh") end function maximize_window() @@ -185,6 +185,6 @@ in { }) end - maximize_window():map("wm") + maximize_window():map("wm") ''; }