{ globals.mapleader = " "; keymaps = [ { mode = ["n" "x"]; key = "j"; action = "v:count == 0 ? 'gj' : 'j'"; options = {expr = true; silent = true;}; } { mode = ["n" "x"]; key = ""; action = "v:count == 0 ? 'gj' : 'j'"; options = {expr = true; silent = true;}; } { mode = ["n" "x"]; key = "k"; action = "v:count == 0 ? 'gk' : 'k'"; options = {expr = true; silent = true;}; } { mode = ["n" "x"]; key = ""; action = "v:count == 0 ? 'gk' : 'k'"; options = {expr = true; silent = true;}; } { mode = "n"; key = ""; action = "h"; options = {desc = "Go to Left Window"; remap = true;}; } { mode = "n"; key = ""; action = "j"; options = {desc = "Go to Lower Window"; remap = true;}; } { mode = "n"; key = ""; action = "k"; options = {desc = "Go to Upper Window"; remap = true;}; } { mode = "n"; key = ""; action = "l"; options = {desc = "Go to Right Window"; remap = true;}; } { mode = "n"; key = ""; action = "resize +2"; options = {desc = "Increase Window Height";}; } { mode = "n"; key = ""; action = "resize -2"; options = {desc = "Decrease Window Height";}; } { mode = "n"; key = ""; action = "vertical resize -2"; options = {desc = "Decrease Window Width";}; } { mode = "n"; key = ""; action = "vertical resize +2"; options = {desc = "Increase Window Width";}; } { mode = "n"; key = ""; action = "m .+1=="; options = {desc = "Move Down";}; } { mode = "n"; key = ""; action = "m .-2=="; options = {desc = "Move Up";}; } { mode = "i"; key = ""; action = "m .+1==gi"; options = {desc = "Move Down";}; } { mode = "i"; key = ""; action = "m .-2==gi"; options = {desc = "Move Up";}; } { mode = "v"; key = ""; action = ":m '>+1gv=gv"; options = {desc = "Move Down";}; } { mode = "v"; key = ""; action = ":m '<-2gv=gv"; options = {desc = "Move Up";}; } { mode = "i"; key = ";"; action = ";u"; } { mode = "i"; key = "."; action = ".u"; } { mode = "i"; key = ";"; action = ";u"; } { mode = ["i" "x" "n" "s"]; key = ""; action = "w"; options = {desc = "Save File";}; } { mode = ["i" "n"]; key = ""; action = "noh"; options = {desc = "Escape and Clear hlsearch";}; } { mode = "n"; key = "ur"; action = "nohlsearchdiffupdatenormal! "; options = {desc = "Redraw / Clear hlsearch / Diff Update";}; } { mode = "n"; key = "n"; action = "'Nn'[v:searchforward].'zv'"; options = {expr = true; desc = "Next Search Result";}; } { mode = "x"; key = "n"; action = "'Nn'[v:searchforward]"; options = {expr = true; desc = "Next Search Result";}; } { mode = "o"; key = "n"; action = "'Nn'[v:searchforward]"; options = {expr = true; desc = "Next Search Result";}; } { mode = "n"; key = "N"; action = "'nN'[v:searchforward].'zv'"; options = {expr = true; desc = "Prev Search Result";}; } { mode = "x"; key = "N"; action = "'nN'[v:searchforward]"; options = {expr = true; desc = "Prev Search Result";}; } { mode = "o"; key = "N"; action = "'nN'[v:searchforward]"; options = {expr = true; desc = "Prev Search Result";}; } { mode = ["n" "v"]; key = "cf"; action = "function()\n LazyVim.format({ force = true })\nend"; options = {desc = "Format";}; } { mode = "n"; key = "cd"; action = "vim.diagnostic.open_float"; options = {desc = "Line Diagnostics";}; } { mode = "n"; key = "]d"; action = "diagnostic_goto(true)"; options = {desc = "Next Diagnostic";}; } { mode = "n"; key = "[d"; action = "diagnostic_goto(false)"; options = {desc = "Prev Diagnostic";}; } { mode = "n"; key = "]e"; action = "diagnostic_goto(true 'ERROR')"; options = {desc = "Next Error";}; } { mode = "n"; key = "[e"; action = "diagnostic_goto(false 'ERROR')"; options = {desc = "Prev Error";}; } { mode = "n"; key = "]w"; action = "diagnostic_goto(true 'WARN')"; options = {desc = "Next Warning";}; } { mode = "n"; key = "[w"; action = "diagnostic_goto(false 'WARN')"; options = {desc = "Prev Warning";}; } { mode = "n"; key = "uf"; action = "function() LazyVim.format.toggle() end"; options = {desc = "Toggle Auto Format (Global)";}; } { mode = "n"; key = "uF"; action = "function() LazyVim.format.toggle(true) end"; options = {desc = "Toggle Auto Format (Buffer)";}; } { mode = "n"; key = "us"; action = "function() LazyVim.toggle('spell') end"; options = {desc = "Toggle Spelling";}; } { mode = "n"; key = "uw"; action = "function() LazyVim.toggle('wrap') end"; options = {desc = "Toggle Word Wrap";}; } { mode = "n"; key = "uL"; action = "function() LazyVim.toggle('relativenumber') end"; options = {desc = "Toggle Relative Line Numbers";}; } { mode = "n"; key = "ul"; action = "function() LazyVim.toggle.number() end"; options = {desc = "Toggle Line Numbers";}; } { mode = "n"; key = "ud"; action = "function() LazyVim.toggle.diagnostics() end"; options = {desc = "Toggle Diagnostics";}; } { mode = "n"; key = "uc"; action = "function() LazyVim.toggle('conceallevel'; false; {0; conceallevel}) end"; options = {desc = "Toggle Conceal";}; } { mode = "n"; key = "uh"; action = "function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end"; options = {desc = "Toggle Treesitter Highlight";}; } { mode = "n"; key = "ub"; action = "function() LazyVim.toggle('background'; false; {'light'; 'dark'}) end"; options = {desc = "Toggle Background";}; } { mode = "n"; key = "gg"; action = "function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end"; options = {desc = "Lazygit (Root Dir)";}; } { mode = "n"; key = "gG"; action = "function() LazyVim.lazygit() end"; options = {desc = "Lazygit (cwd)";}; } { mode = "n"; key = "gb"; action = "LazyVim.lazygit.blame_line"; options = {desc = "Git Blame Line";}; } { mode = "n"; key = "gf"; action = "function()\n local git_path = vim.api.nvim_buf_get_name(0)\n LazyVim.lazygit({args = { \"-f\"; vim.trim(git_path) }})\nend"; options = {desc = "Lazygit Current File History";}; } { mode = "n"; key = "qq"; action = "qa"; options = {desc = "Quit All";}; } { mode = "n"; key = "ui"; action = "vim.show_pos"; options = {desc = "Inspect Pos";}; } { mode = "n"; key = "ft"; action = "lazyterm"; options = {desc = "Terminal (Root Dir)";}; } { mode = "n"; key = "fT"; action = "function() LazyVim.terminal() end"; options = {desc = "Terminal (cwd)";}; } { mode = "n"; key = ""; action = "lazyterm"; options = {desc = "Terminal (Root Dir)";}; } { mode = "n"; key = ""; action = "lazyterm"; options = {desc = "which_key_ignore";}; } { mode = "t"; key = ""; action = ""; options = {desc = "Enter Normal Mode";}; } { mode = "t"; key = ""; action = "wincmd h"; options = {desc = "Go to Left Window";}; } { mode = "t"; key = ""; action = "wincmd j"; options = {desc = "Go to Lower Window";}; } { mode = "t"; key = ""; action = "wincmd k"; options = {desc = "Go to Upper Window";}; } { mode = "t"; key = ""; action = "wincmd l"; options = {desc = "Go to Right Window";}; } { mode = "t"; key = ""; action = "close"; options = {desc = "Hide Terminal";}; } { mode = "t"; key = ""; action = "close"; options = {desc = "which_key_ignore";}; } { mode = "n"; key = "ww"; action = "p"; options = {desc = "Other Window"; remap = true;}; } { mode = "n"; key = "wd"; action = "c"; options = {desc = "Delete Window"; remap = true;}; } { mode = "n"; key = "w-"; action = "s"; options = {desc = "Split Window Below"; remap = true;}; } { mode = "n"; key = "w|"; action = "v"; options = {desc = "Split Window Right"; remap = true;}; } { mode = "n"; key = "-"; action = "s"; options = {desc = "Split Window Below"; remap = true;}; } { mode = "n"; key = "|"; action = "v"; options = {desc = "Split Window Right"; remap = true;}; } { mode = "n"; key = "l"; action = "tablast"; options = {desc = "Last Tab";}; } { mode = "n"; key = "f"; action = "tabfirst"; options = {desc = "First Tab";}; } { mode = "n"; key = ""; action = "tabnew"; options = {desc = "New Tab";}; } { mode = "n"; key = "]"; action = "tabnext"; options = {desc = "Next Tab";}; } { mode = "n"; key = "d"; action = "tabclose"; options = {desc = "Close Tab";}; } { mode = "n"; key = "["; action = "tabprevious"; options = {desc = "Previous Tab";}; } ]; }