Nvim Commands 101 ๐Ÿ––๐Ÿป

Inside a block keys -

ActionCommand
yank inside " " / () / {} / []yi" / () / {} / []
delete inside " " / () / {} / []di" / () / {} / []
edit inside " " / () / {} / []ci" / () / {} / []

Whole line operations-

ActionsCommand
dddelete the whole line
ccchange the whole line
yycopies the whole line
Vselect the whole line
Ddelete the line from cursor to the end
Cchanges the line from cursor to the end
Ycopies the whole line
d0delete the line form cursor to the start
c0change the line form cursor to start
v0select the lilne from cursor to the start
y0yank the line form cursor to the start

Motions -

ActionCommnad
h / j / k / lmove left/down/up/right
W/wmove one word forward
B/bmove one word backward
ggmove to the top of the file
Gmove to the end of the file
zzmove the window to the middle
omove to the next line with edit mode
shift + hmove to the tab on the left
shift + lmove to the tab on the right
shift + [move down in file (fast)
shift + ]move down in file (fast)

Word commands -

ActionCommands
dwdelete the word you are on
ywyank the word you are on
cwchange the word you are on
ciwchange in word
diwdelete in word
yiwyank in word
viwselect in word
dbdelete previous word
cbchange previous word
ybyank previous word
vbdelete previous word

Searching Commnads -

ActionsCommnads
searchingtype '/' in normal mode, search for keyword, press enter, move between words with 'n' and 'N'
searching
&
replacing:%s/foo/bar/g Find each occurrence of 'foo' (in all lines), and replace it with 'bar'

To find all occurrences of 'foo' in the current line, add the g flag. :s/foo/Vim/g |

Misc Commnads -

ActionCommand
gccComment line
\==fix indentation
0
Subscribe to my newsletter

Read articles from Anirudh Singh Bhadauria directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anirudh Singh Bhadauria
Anirudh Singh Bhadauria

Hello world!, I am a software engineer who loves MMA โœจ I integrate Data engineering and software engineering together to make beautiful software solutions that actually solves problem. I love to make projects that make an impact and as you are reading this I am working on one!