Skip to content

Neovim Cheat Sheet

Normal Mode

KeymapDetails
<C-o>Use to go back after goto definition
<C-i>Use to go back to definition
<C-hjkl>Use ctrl + hjkl keys to focus buffers
<C-wv>Create vertical split
<C-ws>Create horizontal split
%Jump to prev/next [] or () or {}
*Jump through cword items
rChange symbol
<C-a>Increment number
<C-x>Decrement number
diwDelete word from any position
viwpReplace word after previous move
ciwDelete word and switch to insert mode
ci..Delete inside "" or () or {} and switch to insert mode
saiw..Surround with "" or () or {}
sd..Delete surrounding "" or () or {}
vasVisual select blocks
va(Visually select around ( symbol
dt(Delete everything till ( symbol
gccToggles the current line using linewise comment
gbcToggles the current line using blockwise comment
gc[count]{motion}(Op-pending) Toggles the region using linewise comment
gb[count]{motion}(Op-pending) Toggles the region using blockwise comment

Insert Mode

KeymapDetails
<C-o>Exit insert mode for exactly one move

Command Mode

CommandDetails
: %s/old/new/gcChange in current buffer all matching words to new
: s/old/newChange inside selection only first matching for each line (In Visual select mode '<,'>)
: s/old/new/gMatch and replace all (In Visual select mode '<,'>)
: s/old/new/gcMatch, replace all, and ask for each replace (In Visual select mode '<,'>)
:s/\<old\>/new/giReplace exactly old word (older will be ignored)