nvim/KEYMAPS.md

8.0 KiB

Keymap Reference

Living reference of every explicit keymap defined in this config. Use :KeymapsGuide to open this file inside Neovim in a floating window.

lua/keymaps.lua

Mode Key Description Notes
n gd Vim goto-definition fallback Executes normal! gd for tags/include jumps when no LSP
n gD Vim goto-declaration fallback Executes normal! gD
n gr LSP references placeholder <Nop> so LSP buffers can override cleanly
n gI LSP implementation placeholder <Nop> so LSP buffers can override cleanly
n K Keyword help fallback Uses keywordprg (e.g., man) when LSP hover is unavailable
n <leader>xx Diagnostics → location list Populates current buffer diagnostics
n <leader>xX Diagnostics → quickfix Populates project-wide diagnostics
n <leader>xe Diagnostics → buffer errors Location list filtered to errors
n <leader>xE Diagnostics → all errors Quickfix filtered to errors
n [d Diagnostics: previous item Uses vim.diagnostic.goto_prev
n ]d Diagnostics: next item Uses vim.diagnostic.goto_next
n <leader>xd Diagnostic float Opens hover window for cursor diagnostic
n <leader>xt Toggle diagnostics Flips vim.diagnostic.enable()
n <leader>hi Highlight inspector Shows highlight/capture stack under cursor

lua/netrw-config.lua

Mode Key Description
n <leader>te Open netrw in a new tab rooted at current file directory
n <leader>tE Open netrw in a new tab rooted at project cwd

lua/plugins/lsp.lua (buffer-local when an LSP client attaches)

Mode Key Description
n gd LSP: go to definition
n gr LSP: references
n gD LSP: declaration
n gI LSP: implementation
n K LSP hover

lua/plugins/none-ls.lua

Mode Key Description
n <leader>lt Toggle format-on-save flag
n <leader>lf Format current buffer (synchronous)
v <leader>lf Format visual selection

lua/plugins/gitsigns.lua (buffer-local when inside a git repo)

Mode Key Description
n ]h Next hunk (expr mapping that respects diff windows)
n [h Previous hunk
n <leader>hs Stage current hunk
n <leader>hr Reset current hunk
v <leader>hs Stage visually selected range as hunk
v <leader>hr Reset visually selected range
n <leader>hS Stage entire buffer
n <leader>hu Undo last staged hunk
n <leader>hR Reset entire buffer
n <leader>hp Preview hunk
n <leader>hd Diff against index
n <leader>hD Diff against previous commit (~)
o/x ih Text object: select git hunk

lua/plugins/telescope.lua

Launcher mappings (normal mode)

Key Description
<leader>ff Find files
<leader>fg Live grep
<leader>fb Open buffers picker (<C-d> deletes buffers in picker)
<leader>fh Help tags
<leader>fr Recent files (oldfiles)
<leader>/ Fuzzy search current buffer
<leader>fk / <leader>? Telescope keymaps picker
<leader>fc Commands picker
<leader>fs LSP document symbols
<leader>fS LSP workspace symbols

Telescope prompt mappings (defaults.mappings)

Mode Key Description
i <C-n> / <C-j> Move selection down
i <C-p> / <C-k> Move selection up
i <C-c> Close picker
i <CR> Accept selection
i <C-x> Open selection in horizontal split
i <C-v> Open selection in vertical split
i <C-t> Open selection in tab
n <Esc> Close picker
n <CR> Accept selection
n <C-x> Horizontal split
n <C-v> Vertical split
n <C-t> New tab
n j Move selection down
n k Move selection up

Picker-specific overrides

Context Mode Key Description
buffers picker i <C-d> Delete highlighted buffer

lua/plugins/oil.lua

Global launcher mappings

Mode Key Description
n <leader>fo Open Oil in current window
n <leader>fO Open Oil in floating window

Oil buffer mappings (opts.keymaps)

Key Description
g? Show Oil help
<CR> Open entry in current window
<C-s> Open entry in vertical split
<C-h> Open entry in horizontal split
<C-t> Open entry in new tab
<C-p> Preview entry (vertical split belowright)
<C-c> Close Oil
<C-l> Refresh
- Go to parent directory
_ Open Neovim cwd
` :cd into entry
~ :tcd into entry
gs Change sort mode
gx Open entry externally
g. Toggle hidden files
g\ Toggle trash visibility

lua/plugins/ufo.lua

Mode Key Description
n zR Open all folds
n zM Close all folds
n zr Open folds except configured kinds
n zm Close folds with configured kinds
n K Peek fold under cursor; falls back to LSP hover
preview window <C-u> / <C-d> Scroll within UFO preview
preview window [ / ] Jump to top/bottom of preview

lua/plugins/undotree.lua

Mode Key Description
n <leader>u Toggle Undotree panel

lua/plugins/treesitter.lua

Incremental selection

Key Description
<CR> Initialize/expand selection
<S-CR> Expand to scope
<BS> Shrink selection

Textobject selection (select.keymaps)

Key Target
af / if Function outer / inner
ac / ic Class outer / inner
aa / ia Parameter outer / inner
ai / ii Conditional outer / inner
al / il Loop outer / inner
a/ Comment outer

Textobject movement (move mappings)

Key Action
]f / ]F Next function start / end
[f / [F Previous function start / end
]c / ]C Next class start / end
[c / [C Previous class start / end
]a / ]A Next parameter start / end
[a / [A Previous parameter start / end

Parameter swapping

Key Description
<leader>a Swap parameter with next
<leader>A Swap parameter with previous

lua/plugins/comment.lua

Mapping Description
gcc Toggle line comment
gbc Toggle block comment
gc Operator-pending line comment
gb Operator-pending block comment
gcO / gco / gcA Insert comment above / below / end-of-line

lua/plugins/surround.lua

Mode Mapping Description
normal ys{motion}{char} Add surround to motion
normal yss Surround current line
normal yS Surround motion with linewise behavior
normal ySS Surround current line linewise
insert <C-g>s Surround following text object
insert <C-g>S Surround current line
visual S Surround selection
visual line gS Surround visual-line selection
normal ds{char} Delete surround
normal cs{old}{new} Change surround
normal cS{old}{new} Change surround (linewise)

lua/plugins/cmp.lua

Mode Key Description
insert <C-Space> Manually trigger completion
insert <CR> Confirm selection (selects first item by default)
insert <C-n> Next completion item
insert <C-p> Previous completion item
insert <C-e> Abort completion menu

lua/plugins/autopairs.lua

Mode Key Description
insert <M-e> Fast wrap the previous text with a pair

lua/keymaps_reference.lua

Command Description
:KeymapsGuide Open this reference in a floating window (read-only)