Neovim commands and shortcuts
Neovim is a modern fork of Vim, scriptable in Lua and shipped with a built-in language server client. Beyond Vim's movement and editing commands, its defaults cover LSP actions like rename and hover, commenting, diagnostics, Treesitter selection, windows, and terminal mode.
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 | Shortcuts |
|---|---|
| Insert before the cursor | Windows / macOS / Linuxi |
| Insert after the cursor | Windows / macOS / Linuxa |
| Open a new line below | Windows / macOS / Linuxo |
| Open a new line above | Windows / macOS / LinuxO |
| Return to normal mode | Windows / macOS / LinuxEsc |
| Move left | Windows / macOS / Linuxh |
| Move down | Windows / macOS / Linuxj |
| Move up | Windows / macOS / Linuxk |
| Move right | Windows / macOS / Linuxl |
| Move to the first non-blank character0 moves to column one. | Windows / macOS / Linux^ |
| Move to the end of the line | Windows / macOS / Linux$ |
| Move to the next word | Windows / macOS / Linuxw |
| Move to the previous word | Windows / macOS / Linuxb |
| Move to the start of the file | Windows / macOS / Linuxg then g |
| Move to the end of the file | Windows / macOS / LinuxG |
| Jump to a matching bracket | Windows / macOS / Linux% |
Editing and search
Delete, yank, paste, undo, select, search, and fold text with the commands inherited from Vim.
| Action | Shortcuts |
|---|---|
| Delete the current line | Windows / macOS / Linuxd then d |
| Delete the character under the cursorX deletes backward. | Windows / macOS / Linuxx |
| Change the word under the cursor | Windows / macOS / Linuxc then i then w |
| Copy (yank) the current line | Windows / macOS / Linuxy then y |
| Paste after the cursorP pastes before the cursor. | Windows / macOS / Linuxp |
| Undo | Windows / macOS / Linuxu |
| Redo | Windows / macOS / LinuxCtrl + r |
| Repeat the last change | Windows / macOS / Linux. |
| Start character-wise visual mode | Windows / macOS / Linuxv |
| Start line-wise visual mode | Windows / macOS / LinuxV |
| Start block-wise visual mode | Windows / macOS / LinuxCtrl + v |
| Search forward? searches backward; n and N move through matches. | Windows / macOS / Linux/ |
| Search forward for the word under the cursor# searches backward. | Windows / macOS / Linux* |
| Open or close the fold under the cursor | Windows / macOS / Linuxz then a |
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 | Shortcuts |
|---|---|
| Rename the symbol under the cursor | Windows / macOS / Linuxg then r then n |
| List references to the symbol | Windows / macOS / Linuxg then r then r |
| List implementations | Windows / macOS / Linuxg then r then i |
| Go to the type definition | Windows / macOS / Linuxg then r then t |
| Run the code lens under the cursor | Windows / macOS / Linuxg then r then x |
| Go to the definition | Windows / macOS / Linuxg then d |
| Go to the declaration | Windows / macOS / Linuxg then D |
| Show hover information | Windows / macOS / LinuxK |
| Select a code action | Windows / macOS / Linuxg then r then a |
| Open document symbols | Windows / macOS / Linuxg then O |
| Open the document link under the cursor | Windows / macOS / Linuxg then x |
| Show signature help in Insert mode | Windows / macOS / LinuxCtrl + s |
| Jump to the tag or definition under the cursorThe attached LSP client can provide the tagfunc result. | Windows / macOS / LinuxCtrl + ] |
| Open the tag or definition in a splitThe attached LSP client can provide the tagfunc result. | Windows / macOS / LinuxCtrl + w then ] |
| Preview the tag or definition in a new windowThe attached LSP client can provide the tagfunc result. | Windows / macOS / LinuxCtrl + w then } |
| Format lines through the attached language servergq remains the core format operator; with LSP, formatexpr routes it to the server when supported. | Windows / macOS / Linuxg then q |
| Trigger omnifunc completionAn attached LSP client sets omnifunc when it supports completion. | Windows / macOS / LinuxCtrl + x then Ctrl + o |
Commenting and diagnostics
Use Neovim's built-in commenting and diagnostic mappings when the filetype or attached language tooling provides the required support.
| Action | Shortcuts |
|---|---|
| Toggle the comment on the current line | Windows / macOS / Linuxg then c then c |
| Toggle comments over a motion or selectionUse a motion or Visual selection to choose the range. | Windows / macOS / Linuxg then c |
| Jump to the previous diagnostic]d jumps to the next one. | Windows / macOS / Linux[ then d |
| Jump to the first diagnostic in the buffer]D jumps to the last diagnostic. | Windows / macOS / Linux[ then D |
| Jump to the last diagnostic in the buffer[D jumps to the first diagnostic. | Windows / macOS / Linux] then D |
| Show diagnostics in a floating window | Windows / macOS / LinuxCtrl + w then d |
| Jump to the previous quickfix item]q jumps to the next quickfix item. | Windows / macOS / Linux[ then q |
| Jump to the next quickfix item[q jumps to the previous quickfix item. | Windows / macOS / Linux] then 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 | Shortcuts |
|---|---|
| Select the parent syntax nodean is the Visual-mode command; it expands to a parent node. | Windows / macOS / Linuxv then a then n |
| Select the previous or first child syntax nodein is the Visual-mode command; it narrows to a child node. | Windows / macOS / Linuxv then i then n |
| Select the next syntax node | Windows / macOS / Linuxv then ] then n |
| Select the previous syntax node | Windows / macOS / Linuxv then [ then n |
| Expand the selection to the next syntax node | Windows / macOS / Linuxv then ] then N |
| Expand the selection to the previous syntax node | Windows / macOS / Linuxv then [ then 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 | Shortcuts |
|---|---|
| Split the window horizontally | Windows / macOS / LinuxCtrl + w then s |
| Split the window vertically | Windows / macOS / LinuxCtrl + w then v |
| Move to the next window | Windows / macOS / LinuxCtrl + w then w |
| Move to the window on the left | Windows / macOS / LinuxCtrl + w then h |
| Move to the window below | Windows / macOS / LinuxCtrl + w then j |
| Move to the window above | Windows / macOS / LinuxCtrl + w then k |
| Move to the window on the right | Windows / macOS / LinuxCtrl + w then l |
| Open a terminal bufferPress Enter after the :terminal command. | Windows / macOS / Linux: then terminal |
| Leave terminal mode for normal mode | Windows / macOS / LinuxCtrl + \ then Ctrl + n |
| Jump to the previous shell commandRequires shell integration that emits OSC 133 markers. | Windows / macOS / Linux[ then [ |
| Jump to the next shell commandRequires shell integration that emits OSC 133 markers. | Windows / macOS / Linux] then ] |
Source
official Neovim quick reference and LSP defaults · Checked
Core behavior and built-in mappings from the official Neovim quick reference and LSP documentation checked in August 2026. LSP mappings appear when a language server attaches; plugin and user keymaps can add or replace any of these commands. See https://neovim.io/doc/user/lsp/ for the LSP defaults.