Neovim keyboard shortcuts
Neovim keeps Vim's modal editing model and adds built-in behavior around it. This reference covers the core motions and operators plus the LSP, commenting, diagnostic, and terminal-mode defaults that distinguish a current Neovim session from a plugin-specific setup.
Windows, macOS, Linux · 72 shortcutsModes and movement
Move through a buffer in normal mode, enter or leave insert mode, and use motions as the grammar for edits.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Insert before the cursor | i | i | i |
| Insert after the cursor | a | a | a |
| Open a new line below | o | o | o |
| Open a new line above | O | O | O |
| Return to normal mode | Esc | Esc | Esc |
| Move left | h | h | h |
| Move down | j | j | j |
| Move up | k | k | k |
| Move right | l | l | l |
| Move to the first non-blank character0 moves to column one. | ^ | ^ | ^ |
| Move to the end of the line | $ | $ | $ |
| Move to the next word | w | w | w |
| Move to the previous word | b | b | b |
| Move to the start of the file | gg | gg | gg |
| Move to the end of the file | G | G | G |
| Jump to a matching bracket | % | % | % |
Editing and search
Delete, yank, paste, undo, select, search, and fold text with the commands inherited from Vim.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Delete the current line | dd | dd | dd |
| Delete the character under the cursorX deletes backward. | x | x | x |
| Change the word under the cursor | ciw | ciw | ciw |
| Copy (yank) the current line | yy | yy | yy |
| Paste after the cursorP pastes before the cursor. | p | p | p |
| Undo | u | u | u |
| Redo | Ctrlr | Ctrlr | Ctrlr |
| Repeat the last change | . | . | . |
| Start character-wise visual mode | v | v | v |
| Start line-wise visual mode | V | V | V |
| Start block-wise visual mode | Ctrlv | Ctrlv | Ctrlv |
| Search forward? searches backward; n and N move through matches. | / | / | / |
| Search forward for the word under the cursor# searches backward. | * | * | * |
| Open or close the fold under the cursor | za | za | za |
Language server defaults
When an LSP client attaches, these built-in normal- and insert-mode mappings expose navigation, rename, actions, symbols, links, signatures, and hover information.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Rename the symbol under the cursor | grn | grn | grn |
| List references to the symbol | grr | grr | grr |
| List implementations | gri | gri | gri |
| Go to the type definition | grt | grt | grt |
| Run the code lens under the cursor | grx | grx | grx |
| Go to the definition | gd | gd | gd |
| Go to the declaration | gD | gD | gD |
| Show hover information | K | K | K |
| Select a code action | gra | gra | gra |
| Open document symbols | gO | gO | gO |
| Open the document link under the cursor | gx | gx | gx |
| Show signature help in Insert mode | Ctrls | Ctrls | Ctrls |
| Jump to the tag or definition under the cursorThe attached LSP client can provide the tagfunc result. | Ctrl] | Ctrl] | Ctrl] |
| Open the tag or definition in a splitThe attached LSP client can provide the tagfunc result. | Ctrlw] | Ctrlw] | Ctrlw] |
| Preview the tag or definition in a new windowThe attached LSP client can provide the tagfunc result. | Ctrlw} | Ctrlw} | Ctrlw} |
| Format lines through the attached language servergq remains the core format operator; with LSP, formatexpr routes it to the server when supported. | gq | gq | gq |
| Trigger omnifunc completionAn attached LSP client sets omnifunc when it supports completion. | CtrlxCtrlo | CtrlxCtrlo | CtrlxCtrlo |
Commenting and diagnostics
Use Neovim's built-in commenting and diagnostic mappings when the filetype or attached language tooling provides the required support.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Toggle the comment on the current line | gcc | gcc | gcc |
| Toggle comments over a motion or selectionUse a motion or Visual selection to choose the range. | gc | gc | gc |
| Jump to the previous diagnostic]d jumps to the next one. | [d | [d | [d |
| Jump to the first diagnostic in the buffer]D jumps to the last diagnostic. | [D | [D | [D |
| Jump to the last diagnostic in the buffer[D jumps to the first diagnostic. | ]D | ]D | ]D |
| Show diagnostics in a floating window | Ctrlwd | Ctrlwd | Ctrlwd |
| Jump to the previous quickfix item]q jumps to the next quickfix item. | [q | [q | [q |
| Jump to the next quickfix item[q jumps to the previous quickfix item. | ]q | ]q | ]q |
Treesitter selection defaults
With a Treesitter parser, these Visual-mode mappings select syntax nodes; Neovim can fall back to LSP selection ranges for the parent and child commands.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Select the parent syntax nodean is the Visual-mode command; it expands to a parent node. | van | van | van |
| Select the previous or first child syntax nodein is the Visual-mode command; it narrows to a child node. | vin | vin | vin |
| Select the next syntax node | v]n | v]n | v]n |
| Select the previous syntax node | v[n | v[n | v[n |
| Expand the selection to the next syntax node | v]N | v]N | v]N |
| Expand the selection to the previous syntax node | v[N | v[N | v[N |
Windows and terminal mode
Split the editor and move between windows, then leave terminal mode when a running program has captured the keyboard.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Split the window horizontally | Ctrlws | Ctrlws | Ctrlws |
| Split the window vertically | Ctrlwv | Ctrlwv | Ctrlwv |
| Move to the next window | Ctrlww | Ctrlww | Ctrlww |
| Move to the window on the left | Ctrlwh | Ctrlwh | Ctrlwh |
| Move to the window below | Ctrlwj | Ctrlwj | Ctrlwj |
| Move to the window above | Ctrlwk | Ctrlwk | Ctrlwk |
| Move to the window on the right | Ctrlwl | Ctrlwl | Ctrlwl |
| Open a terminal bufferPress Enter after the :terminal command. | :terminal | :terminal | :terminal |
| Leave terminal mode for normal mode | Ctrl\Ctrln | Ctrl\Ctrln | Ctrl\Ctrln |
| Jump to the previous shell commandRequires shell integration that emits OSC 133 markers. | [[ | [[ | [[ |
| Jump to the next shell commandRequires shell integration that emits OSC 133 markers. | ]] | ]] | ]] |