Neovim keyboard shortcuts
Neovim is a modern fork of Vim with a built-in language server client and terminal. It keeps Vim's keys and adds default maps for code actions, rename, diagnostics and comments.
Most used Neovim keyboard shortcuts
The Neovim shortcuts worth learning first. The full list follows, grouped by task.
- Return to Normal modeMacEscorCtrl[WindowsEscorCtrl[LinuxEscorCtrl[
- Comment or uncomment the lineMacG,C,CWindowsG,C,CLinuxG,C,C
- Show documentation for the symbolMacShiftKWindowsShiftKLinuxShiftK
- Rename the symbolMacG,R,NWindowsG,R,NLinuxG,R,N
- Code actionsMacG,R,AWindowsG,R,ALinuxG,R,A
- List referencesMacG,R,RWindowsG,R,RLinuxG,R,R
- Next diagnosticMac],DWindows],DLinux],D
- Show the diagnostic under the cursorMacCtrlW,DWindowsCtrlW,DLinuxCtrlW,D
- Clear search highlighting and redrawMacCtrlLWindowsCtrlLLinuxCtrlL
- Save the fileMacShift;,W,EnterWindowsShift;,W,EnterLinuxShift;,W,Enter
Modes
8 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Insert before the cursorNormal mode | I | I | I |
| Append after the cursorNormal mode | A | A | A |
| Open a new line below and insertNormal mode | O | O | O |
| Return to Normal modeInsert or Visual mode | EscorCtrl[ | EscorCtrl[ | EscorCtrl[ |
| Start Visual modeNormal mode | V | V | V |
| Start Visual Line modeNormal mode | ShiftV | ShiftV | ShiftV |
| Start Visual Block modeNormal mode | CtrlV | CtrlV | CtrlV |
| Leave Terminal modeTerminal mode | Ctrl\,CtrlN | Ctrl\,CtrlN | Ctrl\,CtrlN |
Moving
14 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Go to the first lineNormal mode | G,G | G,G | G,G |
| Go to the last lineNormal mode | ShiftG | ShiftG | ShiftG |
| Next wordNormal mode | W | W | W |
| Previous wordNormal mode | B | B | B |
| Start of the lineNormal mode | 0 | 0 | 0 |
| End of the lineNormal mode | Shift4 | Shift4 | Shift4 |
| Scroll half a page downNormal mode | CtrlD | CtrlD | CtrlD |
| Scroll half a page upNormal mode | CtrlU | CtrlU | CtrlU |
| Jump backNormal mode | CtrlO | CtrlO | CtrlO |
| Jump forwardNormal mode | CtrlI | CtrlI | CtrlI |
| Next quickfix itemNormal mode | ],Q | ],Q | ],Q |
| Previous quickfix itemNormal mode | [,Q | [,Q | [,Q |
| Next bufferNormal mode | ],B | ],B | ],B |
| Previous bufferNormal mode | [,B | [,B | [,B |
Editing
12 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| UndoNormal mode | U | U | U |
| RedoNormal mode | CtrlR | CtrlR | CtrlR |
| Delete (cut) the lineNormal mode | D,D | D,D | D,D |
| Copy (yank) the lineNormal mode | Y,Y | Y,Y | Y,Y |
| Copy (yank) to the end of the lineNormal mode | ShiftY | ShiftY | ShiftY |
| Paste after the cursorNormal mode | P | P | P |
| Repeat the last changeNormal mode | . | . | . |
| Repeat the last :s with its flagsNormal mode | Shift7 | Shift7 | Shift7 |
| Replay the last recorded macroNormal mode | ShiftQ | ShiftQ | ShiftQ |
| Comment or uncomment the lineNormal mode | G,C,C | G,C,C | G,C,C |
| Comment or uncomment the selectionVisual mode | G,C | G,C | G,C |
| Complete the wordInsert mode | CtrlN | CtrlN | CtrlN |
Language server
11 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Show documentation for the symbolNormal mode, language server attached | ShiftK | ShiftK | ShiftK |
| Rename the symbolNormal mode, language server attached | G,R,N | G,R,N | G,R,N |
| Code actionsNormal mode, language server attached | G,R,A | G,R,A | G,R,A |
| List referencesNormal mode, language server attached | G,R,R | G,R,R | G,R,R |
| List implementationsNormal mode, language server attached | G,R,I | G,R,I | G,R,I |
| List symbols in the fileNormal mode, language server attached | G,ShiftO | G,ShiftO | G,ShiftO |
| Go to the definitionNormal mode, language server attached | Ctrl] | Ctrl] | Ctrl] |
| Show the signatureInsert mode, language server attached | CtrlS | CtrlS | CtrlS |
| Next diagnosticNormal mode | ],D | ],D | ],D |
| Previous diagnosticNormal mode | [,D | [,D | [,D |
| Show the diagnostic under the cursorNormal mode | CtrlW,D | CtrlW,D | CtrlW,D |
Search, files and windows
11 shortcuts| Action | Mac | Windows | Linux |
|---|---|---|---|
| Search forwardNormal mode | / | / | / |
| Next matchNormal mode | N | N | N |
| Search for the word under the cursorNormal mode | Shift8 | Shift8 | Shift8 |
| Clear search highlighting and redrawNormal mode | CtrlL | CtrlL | CtrlL |
| Save the fileNormal mode | Shift;,W,Enter | Shift;,W,Enter | Shift;,W,Enter |
| Save and quitNormal mode | ShiftZ,ShiftZ | ShiftZ,ShiftZ | ShiftZ,ShiftZ |
| Quit without savingNormal mode | ShiftZ,ShiftQ | ShiftZ,ShiftQ | ShiftZ,ShiftQ |
| Split the window verticallyNormal mode | CtrlW,V | CtrlW,V | CtrlW,V |
| Split the window horizontallyNormal mode | CtrlW,S | CtrlW,S | CtrlW,S |
| Go to the next windowNormal mode | CtrlW,W | CtrlW,W | CtrlW,W |
| Close the windowNormal mode | CtrlW,Q | CtrlW,Q | CtrlW,Q |
No shortcuts match. Try fewer words, the key names only, or search every app.
Show the key map: which keys Neovim uses mostDarker orange = used by more shortcuts
Neovim's own default keys: comments, LSP and diagnostics
Neovim adds default mappings that plain Vim does not have. The LSP keys work once a language server is attached to the buffer.
- Comment or uncomment the selectionMacG,CWindowsG,CLinuxG,C
- List implementationsMacG,R,IWindowsG,R,ILinuxG,R,I
- List symbols in the fileMacG,ShiftOWindowsG,ShiftOLinuxG,ShiftO
- Go to the definitionMacCtrl]WindowsCtrl]LinuxCtrl]
- Show the signatureMacCtrlSWindowsCtrlSLinuxCtrlS
- Previous diagnosticMac[,DWindows[,DLinux[,D
- Next quickfix itemMac],QWindows],QLinux],Q
- Previous quickfix itemMac[,QWindows[,QLinux[,Q
- Next bufferMac],BWindows],BLinux],B
- Previous bufferMac[,BWindows[,BLinux[,B
- Leave Terminal modeMacCtrl\,CtrlNWindowsCtrl\,CtrlNLinuxCtrl\,CtrlN
- Repeat the last :s with its flagsMacShift7WindowsShift7LinuxShift7
- Replay the last recorded macroMacShiftQWindowsShiftQLinuxShiftQ
- Comment a line
- gcc comments or uncomments the current line and gc a selection or motion (gcap comments a paragraph). Built in since Neovim 0.10.
Vim motions and edits in Neovim
- Insert before the cursorMacIWindowsILinuxI
- Append after the cursorMacAWindowsALinuxA
- Open a new line below and insertMacOWindowsOLinuxO
- Start Visual modeMacVWindowsVLinuxV
- Start Visual Line modeMacShiftVWindowsShiftVLinuxShiftV
- Start Visual Block modeMacCtrlVWindowsCtrlVLinuxCtrlV
- Go to the first lineMacG,GWindowsG,GLinuxG,G
- Go to the last lineMacShiftGWindowsShiftGLinuxShiftG
- Next wordMacWWindowsWLinuxW
- Previous wordMacBWindowsBLinuxB
- Start of the lineMac0Windows0Linux0
- End of the lineMacShift4WindowsShift4LinuxShift4
- Scroll half a page downMacCtrlDWindowsCtrlDLinuxCtrlD
- Scroll half a page upMacCtrlUWindowsCtrlULinuxCtrlU
- Jump backMacCtrlOWindowsCtrlOLinuxCtrlO
- Jump forwardMacCtrlIWindowsCtrlILinuxCtrlI
- Copy (yank) to the end of the lineMacShiftYWindowsShiftYLinuxShiftY
- Paste after the cursorMacPWindowsPLinuxP
- Repeat the last changeMac.Windows.Linux.
- Complete the wordMacCtrlNWindowsCtrlNLinuxCtrlN
- Search forwardMac/Windows/Linux/
- Next matchMacNWindowsNLinuxN
- Search for the word under the cursorMacShift8WindowsShift8LinuxShift8
Save, quit and split windows in Neovim
- Save and quitMacShiftZ,ShiftZWindowsShiftZ,ShiftZLinuxShiftZ,ShiftZ
- Quit without savingMacShiftZ,ShiftQWindowsShiftZ,ShiftQLinuxShiftZ,ShiftQ
- Split the window verticallyMacCtrlW,VWindowsCtrlW,VLinuxCtrlW,V
- Split the window horizontallyMacCtrlW,SWindowsCtrlW,SLinuxCtrlW,S
Neovim keyboard shortcuts: questions
- Does Neovim use the same keys as Vim?
- Yes. Every Vim motion and command works, and Neovim adds default maps of its own, such as gcc to comment a line, K for documentation and grn to rename a symbol through the language server.
- How do I leave the terminal in Neovim?
- Press Ctrl+\ then Ctrl+N to go from Terminal mode back to Normal mode.
- How do I see the keys a Neovim config or plugin added?
- Type :map (or :nmap for Normal mode) to list mappings, and :verbose nmap <key> to see which file set one. Distributions such as LazyVim show their keys in a popup after you press the leader key (usually Space).
These are the default key bindings in Neovim 0.11, as published by Neovim contributors. Shortcuts that need an extension, an add-in or a changed keymap are left out. Where two combinations do the same thing, both are shown.
Single-system lists: Neovim keyboard shortcuts for Mac, Neovim keyboard shortcuts for Windows, Neovim keyboard shortcuts for Linux.
Each shortcut has its own page with the keys for every system, related shortcuts and the same action in other apps. The printable cheat sheet fits the whole list on one or two pages.