Skip to main content

Neovim

A fast, keyboard-driven editor. These are the most common commands for daily use.


Modes​

KeyWhat it does
iEnter insert mode
EscGo back to normal mode
vEnter visual mode (select text)
VSelect whole lines
:Enter command mode

KeyWhat it does
h j k lMove left / down / up / right
wJump to next word
bJump to previous word
ggGo to top of file
GGo to bottom of file
0Go to start of line
$Go to end of line
Ctrl-dScroll down half page
Ctrl-uScroll up half page
%Jump to matching bracket

Editing​

KeyWhat it does
ddDelete current line
yyCopy current line
pPaste after cursor
uUndo
Ctrl-rRedo
ciwChange word under cursor
di(Delete content inside parentheses
>>Indent line
<<Un-indent line

KeyWhat it does
/textSearch forward
?textSearch backward
nNext match
NPrevious match
*Search word under cursor

Files and Buffers​

KeyWhat it does
:wSave file
:qQuit
:wqSave and quit
:q!Quit without saving
:e filenameOpen a file
:bnNext buffer
:bpPrevious buffer
:bdClose buffer

Windows and Splits​

KeyWhat it does
:spSplit horizontally
:vspSplit vertically
Ctrl-w h/j/k/lMove between splits
Ctrl-w qClose current split

Telescope​

Telescope is a fuzzy finder. It lets you search files, text, and more from a floating window.

Open the file finder​

<Space>ff

Type part of the filename to filter. Press Enter to open, Ctrl-v to open in a vertical split.

Common Telescope shortcuts​

KeyWhat it does
<Space>ffFind files
<Space>fgLive grep (search text in all files)
<Space>fbBrowse open buffers
<Space>fhSearch help tags
<Space>frRecent files

Inside the Telescope window:

KeyWhat it does
Ctrl-j / Ctrl-kMove down / up in results
EnterOpen selected file
Ctrl-vOpen in vertical split
Ctrl-xOpen in horizontal split
Ctrl-tOpen in new tab
EscClose Telescope

ToggleTerm​

ToggleTerm opens a terminal inside Neovim. You can toggle it without leaving the editor.

Toggle the terminal​

:ToggleTerm

Or map it to a key (common setup):

<Ctrl-\>

Multiple terminals​

:ToggleTerm 1   # open terminal 1
:ToggleTerm 2 # open terminal 2

Each number is a separate terminal session.

Inside the terminal​

KeyWhat it does
iEnter insert mode to type commands
Ctrl-\ Ctrl-nExit insert mode (go back to normal mode)
<Ctrl-\>Hide / show the terminal

Quick Reference​

KeyWhat it does
<Space>ffFind files with Telescope
<Space>fgSearch text across files
:ToggleTermOpen / close terminal
Ctrl-\Toggle terminal (if mapped)
ddDelete line
yyCopy line
uUndo
Ctrl-rRedo
ciwChange word
/textSearch in file
:wSave
:q!Quit without saving