Skip to content

Keystrokes

lcfd edited this page Oct 12, 2026 · 11 revisions

The <leader> key is <Space>. Press it and wait: which-key shows every shortcut available in the current context, so this page is a reference, not something to memorize.

Global mappings live in lua/config/keymaps.lua. Plugin-specific ones are in the keys table of each spec in lua/plugins/.

Generic

Keys Action
; Enter command-line mode (same as :)
<C-j> Save the current buffer
H / L Go to the start / end of the line
xx Close the current buffer
xa Close all buffers except the current one
<leader>ff Format the buffer (or the selection)
<leader>z Toggle zen mode
<leader>us Toggle spell checking
<C-\> Toggle the floating terminal
<leader>tc Change the text case of the word/selection (snake, camel, …)

Windows

Keys Action
\ Split vertically
| Close the window
<C-h> / <C-l> Go to the left / right window

Files and search

Keys Action
<leader><space> Find files
<leader>fo Recent files
<leader>fi Search lines in the current buffer
<leader>fw Grep the project
<leader>fW Grep the word under the cursor (or the selection)
<leader>fr Resume the last picker
<leader>gt List TODO / FIX / FIXME comments
]t / [t Next / previous TODO comment
<leader>p File explorer
<leader>o Oil: edit the parent directory as a buffer

Search and replace (Spectre)

Keys Action
<leader>S Toggle Spectre
<leader>sw Search the word under the cursor (or the selection)
<leader>sp Search in the current file

Harpoon

Keys Action
- Add the current file
= Open the quick menu
<leader>1 … <leader>9 Jump to file 1 … 9

LSP

Keys Action
gd Go to definition
gD Go to declaration
gr References
gi Go to implementation
gy Go to type definition
gai / gao Incoming / outgoing calls
K Hover documentation
<leader>rn Rename
<leader>ca Code action
<leader>ds Document symbols (filtered outline)
<leader>dS Workspace symbols
<leader>nf / <leader>nc Generate a function / class docstring (neogen)

Diagnostics

Keys Action
<leader>lj Show the diagnostic under the cursor
<leader>lk List the buffer's diagnostics
]d / [d Next / previous diagnostic

Completion (blink.cmp)

Keys Action
<CR> Accept the selected item
<C-space> Open the menu with LSP items only
<C-n> / <C-p> Next / previous item
<C-e> Close the menu
<C-k> Toggle signature help
<Tab> / <S-Tab> Jump forward / back in a snippet

Text objects and motions

Use the text objects with an operator (d, c, y, v, …), e.g. daf deletes a whole function.

Keys Selects
ii / ai Inner / outer scope block (conditionals)
il / al Inner / outer loop
if / af Inner / outer function or method
ic / ac Inner / outer class
ia / aa Inner / outer argument
im / am Inner / outer function call
Keys Moves to
]m / [m Next / previous reference of the word under the cursor
]M / [M Same, at the end of the line
]s / [s Next / previous scope block

Editing

Keys Action
gcc / gbc Toggle a line / block comment
gc{motion} / gb{motion} Comment a motion (line / block style)
gco / gcO / gcA Add a comment below / above / at the end of the line
ys{motion}{char} Surround a motion (nvim-surround)
ds{char} / cs{old}{new} Delete / change a surrounding pair

Git

Keys Action
<leader>gg Open lazygit
<leader>gf Lazygit history of the current file
<leader>gb Blame the current line

Python

Keys Action
<leader>vs Select a virtual environment
<leader>vc Select a cached virtual environment

Notes and graph

Keys Action
<leader>tt Toggle a Markdown checkbox (obsidian.nvim)
<leader>Gg Global graph (terminal)
<leader>Gl Local graph of the current note (terminal)
<leader>Gb / <leader>GB Global / local graph in the browser
<leader>Gs Stop the graph server

Music (MPD)

Keys Action
<leader>mm Command center
<leader>ms / <leader>ma Add a song / an album to the queue
<leader>ml Playlists
<leader>mp Play / pause
<leader>mn / <leader>mb Next / previous track
<leader>mc Show what's playing

RPG toolkit

Keys Action
<leader>R Open the random tables and dice roller (only in folders with an rpg.toml)

Clone this wiki locally