Default Keymaps

NeoVim ships with keymaps you get for free. These have evolved significantly, especially in 0.10 and 0.11. Knowing them avoids redundant config.

LSP Keymaps (0.11+)

These activate when an LSP client attaches to a buffer:

KeymapModeAction
grnNormalvim.lsp.buf.rename()
graNormal, Visualvim.lsp.buf.code_action()
grrNormalvim.lsp.buf.references()
griNormalvim.lsp.buf.implementation()
grtNormalvim.lsp.buf.type_definition()
grxNormalvim.lsp.codelens.run()
gONormalvim.lsp.buf.document_symbol()
<C-S>Insertvim.lsp.buf.signature_help()
KNormalvim.lsp.buf.hover() (since 0.10)

Tip: The gr prefix is mnemonic: “go refactor” (rename, action, references). gO is “go outline”. These don’t conflict with common custom mappings.

Diagnostic Navigation

KeymapModeAction
]dNormalJump to next diagnostic
[dNormalJump to previous diagnostic
]DNormalJump to last diagnostic
[DNormalJump to first diagnostic
<C-W>dNormalOpen diagnostic float

Unimpaired-Style Navigation (0.11+)

Borrowed from vim-unimpaired, these navigate lists:

KeymapAction
[q / ]qPrevious/next quickfix item
[Q / ]QFirst/last quickfix item
[l / ]lPrevious/next location list item
[L / ]LFirst/last location list item
[t / ]tPrevious/next tag
[T / ]TFirst/last tag
[a / ]aPrevious/next argument
[A / ]AFirst/last argument
[b / ]bPrevious/next buffer
[B / ]BFirst/last buffer

Comment Toggle

KeymapModeAction
gcNormal, VisualToggle comment (motion-based)
gccNormalToggle comment on current line
gc in visualVisualToggle comment on selection
gcc      -- Toggle comment on line
gcap     -- Toggle comment on paragraph
gc3j     -- Toggle comment on 3 lines down
Vjjgc    -- Visual select + toggle comment

Snippet Navigation (0.11+)

KeymapModeAction
<Tab>Insert, SelectJump to next snippet placeholder
<S-Tab>Insert, SelectJump to previous snippet placeholder

These only activate when inside an active snippet. Otherwise, Tab inserts a tab character.

Yanking and Visual

KeymapModeAction
YNormalYank to end of line (y$)
*VisualSearch forward for visual selection
#VisualSearch backward for visual selection
QVisualExecute last macro on each selected line

Tip: Y mapping to y$ makes it consistent with D (delete to end) and C (change to end). In stock Vim, Y is the same as yy (yank whole line), which is inconsistent.

Search and Command Line

KeymapModeAction
<C-L>NormalClear search highlighting + redraw screen
&NormalRepeat last :s substitution

Terminal Mode

KeymapModeAction
<C-\><C-N>TerminalExit terminal mode to normal mode

Gotcha: There’s no built-in easy escape from terminal mode. Many users add: vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-N>") for a double-Escape exit.

What NeoVim Does NOT Map

Common operations you still need to configure yourself:

OperationCommon mappingWhy it’s not default
gd (go to definition)vim.lsp.buf.definition()Conflicts with Vim’s built-in gd (go to local declaration)
<leader>f (find files)telescope/fzfRequires a plugin
<leader>e (file explorer)netrw/oil/nvim-treeStyle preference
<C-h/j/k/l> (window nav)<C-W>h/j/k/lAlready works with <C-W> prefix
Format on savevim.lsp.buf.format()Opt-in behavior

Checking Current Mappings

:map              " Show all mappings
:nmap             " Normal mode only
:imap             " Insert mode only
:verbose map K    " Show where K was mapped and by whom
-- Programmatically check a mapping
local map = vim.fn.maparg("grn", "n", false, true)
print(vim.inspect(map))