let directions = ["h" "j" "k" "l"]; generateMappings = direction: { key = ""; mode = ["n"]; silent = true; action = "${direction}"; }; naviMappings = map generateMappings directions; resizeStep = "2"; resizeMappings = [ { key = ""; mode = ["n"]; silent = true; action = "vertical resize -${resizeStep}"; } { key = ""; mode = ["n"]; silent = true; action = "vertical resize +${resizeStep}"; } { key = ""; mode = ["n"]; silent = true; action = "resize +${resizeStep}"; } { key = ""; mode = ["n"]; silent = true; action = "resize -${resizeStep}"; } ]; moveLineMappings = [ { key = ""; mode = ["n"]; silent = true; action = "m .+1=="; } { key = ""; mode = ["n"]; silent = true; action = "m .-2=="; } ]; saveMappings = [ # Save File { key = ""; mode = ["n"]; silent = true; action = "w"; noremap = true; } { key = ""; mode = ["i"]; silent = true; action = "w"; noremap = true; } { key = ""; mode = ["x"]; silent = true; action = "w"; noremap = true; } { key = ""; mode = ["s"]; silent = true; action = "w"; noremap = true; } ]; generalMappings = [ { key = ""; mode = ["n"]; silent = true; action = "bprevious"; } # Prev Buffer { key = ""; mode = ["n"]; silent = true; action = "bnext"; } # Next Buffer { key = "[b"; mode = ["n"]; silent = true; action = "bprevious"; } # Prev Buffer { key = "]b"; mode = ["n"]; silent = true; action = "bnext"; } # Next Buffer { key = "bb"; mode = ["n"]; silent = true; action = "buffer #"; } # Switch to Other Buffer { key = "`"; mode = ["n"]; silent = true; action = "buffer #"; } # Switch to Other Buffer { key = "bd"; mode = ["n"]; silent = true; action = "bd"; } # Delete Buffer { key = "bo"; mode = ["n"]; silent = true; action = "bufdo bd"; } # Delete Other Buffers { key = "bD"; mode = ["n"]; silent = true; action = "bd | :q"; } # Delete Buffer and Window { key = ""; mode = ["i" "n" "s"]; silent = true; action = "noh"; } # Escape and Clear hlsearch { key = "ur"; mode = ["n"]; silent = true; action = "nohlsearchdiffupdatenormal! "; desc = "Redraw / Clear hlsearch / Diff Update"; } # Redraw / Clear hlsearch / Diff Update { key = "n"; mode = ["n" "x" "o"]; silent = true; action = "n"; } # Next Search Result { key = "N"; mode = ["n" "x" "o"]; silent = true; action = "N"; } # Prev Search Result { key = ""; mode = ["i" "x" "n" "s"]; silent = true; action = "w"; } # Save File { key = "K"; mode = ["n"]; silent = true; action = "norm! K"; } # Keywordprg { key = "gco"; mode = ["n"]; silent = true; action = "oVcxnormal gccfxa"; } # Add Comment Below { key = "gcO"; mode = ["n"]; silent = true; action = "OVcxnormal gccfxa"; } # Add Comment Above { key = "fn"; mode = ["n"]; silent = true; action = "enew"; } # New File { key = "xl"; mode = ["n"]; silent = true; action = "lopen"; } # Location List { key = "xq"; mode = ["n"]; silent = true; action = "copen"; } # Quickfix List { key = "[q"; mode = ["n"]; silent = true; lua = true; action = "vim.cmd.cprev"; } # Previous Quickfix { key = "]q"; mode = ["n"]; silent = true; lua = true; action = "vim.cmd.cnext"; } # Next Quickfix { key = "cf"; mode = ["n" "v"]; silent = true; action = "normal! gq"; } # Format { key = "cd"; mode = ["n"]; silent = true; action = "LspDiagnostics"; } # Line Diagnostics { key = "]d"; mode = ["n"]; silent = true; action = "lnext"; } # Next Diagnostic { key = "[d"; mode = ["n"]; silent = true; action = "lprevious"; } # Prev Diagnostic { key = "]e"; mode = ["n"]; silent = true; action = "lnext"; } # Next Error { key = "[e"; mode = ["n"]; silent = true; action = "lprevious"; } # Prev Error { key = "]w"; mode = ["n"]; silent = true; action = "lnext"; } # Next Warning { key = "[w"; mode = ["n"]; silent = true; action = "lprevious"; } # Prev Warning { key = "uf"; mode = ["n"]; silent = true; action = "ToggleAutoFormat"; } # Toggle Auto Format (Global) { key = "uF"; mode = ["n"]; silent = true; action = "ToggleAutoFormatBuffer"; } # Toggle Auto Format (Buffer) { key = "us"; mode = ["n"]; silent = true; action = "setlocal spell!"; } # Toggle Spelling { key = "uw"; mode = ["n"]; silent = true; action = "set wrap!"; } # Toggle Wrap { key = "uL"; mode = ["n"]; silent = true; action = "set relativenumber!"; } # Toggle Relative Number { key = "ud"; mode = ["n"]; silent = true; action = "LspDiagnosticsToggle"; } # Toggle Diagnostics { key = "ul"; mode = ["n"]; silent = true; action = "set number!"; } # Toggle Line Numbers { key = "uc"; mode = ["n"]; silent = true; action = "set conceallevel=3"; } # Toggle Conceal Level { key = "uA"; mode = ["n"]; silent = true; action = "set showtabline=2"; } # Toggle Tabline { key = "uT"; mode = ["n"]; silent = true; action = "TSToggleHighlight"; } # Toggle Treesitter Highlight { key = "ub"; mode = ["n"]; silent = true; action = "set background=dark"; } # Toggle Dark Background { key = "uD"; mode = ["n"]; silent = true; action = "ToggleDimming"; } # Toggle Dimming { key = "ua"; mode = ["n"]; silent = true; action = "ToggleAnimations"; } # Toggle Animations { key = "ug"; mode = ["n"]; silent = true; action = "IndentGuidesToggle"; } # Toggle Indent Guides { key = "uS"; mode = ["n"]; silent = true; action = "SmoothScrollToggle"; } # Toggle Smooth Scroll { key = "dpp"; mode = ["n"]; silent = true; action = "ToggleProfiler"; } # Toggle Profiler { key = "dph"; mode = ["n"]; silent = true; action = "ToggleProfilerHighlights"; } # Toggle Profiler Highlights { key = "uh"; mode = ["n"]; silent = true; action = "ToggleInlayHints"; } # Toggle Inlay Hints { key = "gb"; mode = ["n"]; silent = true; action = "GitBlame"; } # Git Blame Line { key = "gB"; mode = ["n" "x"]; silent = true; action = "GitBrowseOpen"; } # Git Browse (open) { key = "gY"; mode = ["n" "x"]; silent = true; action = "GitBrowseCopy"; } # Git Browse (copy) { key = "qq"; mode = ["n"]; silent = true; action = "qa!"; } # Quit All { key = "ui"; mode = ["n"]; silent = true; action = "InspectPos"; } # Inspect Pos { key = "uI"; mode = ["n"]; silent = true; action = "InspectTree"; } # Inspect Tree { key = "L"; mode = ["n"]; silent = true; action = "LazyVimChangelog"; } # LazyVim Changelog { key = ""; mode = ["n" "t"]; silent = true; action = ""; } # which_key_ignore { key = "w"; mode = ["n"]; silent = true; action = "windows"; } # Windows { key = "-"; mode = ["n"]; silent = true; action = "split"; } # Split Window Below { key = "|"; mode = ["n"]; silent = true; action = "vsplit"; } # Split Window Right { key = "wd"; mode = ["n"]; silent = true; action = "close"; } # Delete Window { key = "wm"; mode = ["n"]; silent = true; action = "ZoomModeToggle"; } # Toggle Zoom Mode { key = "uZ"; mode = ["n"]; silent = true; action = "ZoomModeToggle"; } # Toggle Zoom Mode { key = "uz"; mode = ["n"]; silent = true; action = "ZenModeToggle"; } # Toggle Zen Mode { key = "l"; mode = ["n"]; silent = true; action = "tabprevious"; } # Last Tab { key = "o"; mode = ["n"]; silent = true; action = "tabnew"; } # Close Other Tabs { key = "f"; mode = ["n"]; silent = true; action = "tabfirst"; } # First Tab { key = ""; mode = ["n"]; silent = true; action = "tabnew"; } # New Tab { key = "]"; mode = ["n"]; silent = true; action = "tabnext"; } # Next Tab { key = "d"; mode = ["n"]; silent = true; action = "tabclose"; } # Close Tab { key = "["; mode = ["n"]; silent = true; action = "tabprevious"; } # Previous Tab ]; in naviMappings ++ resizeMappings ++ moveLineMappings ++ saveMappings ++ generalMappings