Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Keymaps Documentation

This page lists the non-negotiable keymaps from keymaps.lua: P0 covers daily survival commands, and P1 covers important workflow accelerators. Minor toggles, legacy duplicates, and low-frequency helpers are intentionally omitted.

P0 Keymaps

Editing and Buffers

ModeKeyActionDescription
Normal<leader>w:wSave the current file
Normal<leader>c:qClose the current window
Normal<leader>q:bdDelete the current buffer
Normal<space>[:bprevGo to the previous buffer
Normal<space>]:bnextGo to the next buffer
Normal<Esc><Esc>:nohClear search highlighting
Insert<C-l><Esc>Leave Insert mode
Visual<C-l><Esc>Leave Visual mode
ModeKeyActionDescription
Normal<leader>ffTelescope find_filesFind files in the project
Normal<leader>fgTelescope live_grepSearch text across the project
Normal<leader>fbTelescope buffersSwitch between open buffers
Normal<C-t>Neotree toggleToggle the file tree

LSP and Code Navigation

ModeKeyActionDescription
Normalgdvim.lsp.buf.definitionGo to definition
NormalgDvim.lsp.buf.declarationGo to declaration
Normalgivim.lsp.buf.implementationGo to implementation
Normalgrvim.lsp.buf.referencesList references
NormalKLspsaga hover_docShow hover documentation
Normal<C-k>vim.lsp.buf.signature_helpShow signature help
Normal<space>rnvim.lsp.buf.renameRename symbol
Normal, Visualzivim.lsp.buf.code_actionOpen code actions
Normal<space>fvim.lsp.buf.formatFormat the current buffer
Visual<space>qfvim.lsp.buf.range_formattingFormat the selected range
Normalzjvim.diagnostic.goto_prevGo to previous diagnostic
Normalzkvim.diagnostic.goto_nextGo to next diagnostic
NormalzoLspsaga show_line_diagnosticsShow diagnostics for the current line

Git

ModeKeyActionDescription
Normal<leader>g:GOpen Fugitive Git status
Normal<space>gdGitsigns diffthis HEAD~1Diff current file against previous commit
Normal<space>gjGitsigns next_hunkGo to next Git hunk
Normal<space>gkGitsigns prev_hunkGo to previous Git hunk
Normal<space>gsGitsigns stage_hunkStage current hunk
Normal<space>guGitsigns undo_stage_hunkUndo staged hunk

Debugging

ModeKeyActionDescription
Normal<leader>dbdap.toggle_breakpoint()Toggle breakpoint
Normal<leader>dcdap.continue()Start or continue debugging
Normal<leader>didap.step_into()Step into
Normal<leader>dodap.step_over()Step over
Normal<Leader>dkdap.step_out()Step out
Normal<leader>dtdapui.toggle()Toggle DAP UI
Normal<leader>dqdap.terminate()Stop debugging

P1 Keymaps

ModeKeyActionDescription
Normal<space>aaharpoon.mark.add_file()Add current file to Harpoon
Normal<space>atharpoon.ui.toggle_quick_menu()Open Harpoon quick menu
Normal<space>awharpoon.ui.nav_next()Go to next Harpoon file
Normal<space>asharpoon.ui.nav_prev()Go to previous Harpoon file
Normal<leader>hvsplitSplit window to the left
Normal<leader>jsplit then move downSplit window below
Normal<leader>ksplitSplit window above/current
Normal<leader>lvsplit then move rightSplit window to the right
Normal<space><Tab>OutlineToggle symbols outline

Tests

ModeKeyActionDescription
Normal<leader>tnneotest.run.run()Run nearest test
Normal<leader>ttneotest.run.run(current file)Run the current test file
Normal<leader>tdneotest.run.run({ strategy = "dap" })Debug nearest test
Normal<leader>tsneotest.run.stop()Stop nearest test run
Normal<leader>toneotest.output.open({ enter = true })Open test output
Normal<leader>tpneotest.output_panel.toggle()Toggle test output panel
Normal<leader>tvneotest.summary.toggle()Toggle test summary

AI Assistance

ModeKeyActionDescription
Insert<C-J>copilot#Accept()Accept Copilot suggestion
Normal<leader>agCodeCompanionChatOpen CodeCompanion chat
Normal<leader>ahCodeCompanionActionsOpen CodeCompanion actions
Normal<leader>iChatGPTOpen ChatGPT

Supporting Tools

ModeKeyActionDescription
NormalUUndotreeToggleToggle undo history
Normal, VisualgaEasyAlignAlign text
Normal<leader>xzvim.lsp.inlay_hint.enable(...)Toggle inlay hints