Vim Command
(resources: https://vim.fandom.com/wiki/Moving_lines_up_or_down)
+
jump to next lineG
jump to last line of the fileo
insert new lineggVG
selects all content. gg moves to first line. V starts visual mode. G jumps to last line thereby selecting from first to last lineTo go to first line of a file press
Esc
and chose one of the following:gg
, or:1
, or1G
, or1gg
Ctrl o
+0
==> go to start of the line$
==> go to end of file1
+G
==> jump to the first line2
+G
==> jump to the second lineo
==> insert in a new linea
==> insert after cursorA
==> insert at the of the linei
==> insert before cursorG
+o
==> insert at the end of a file
vim + myfile.txt
==> insert at the end of a file (add an automatic G)/" dt"
==> find the first quote and delete till next quotedw
==> delete worddi"
==> delete word within "da"
==> delete word within " including the "dG
==> delete from cursor until the end of the filed$
==> delete from cursor until the end of the linex
delete character:s/toReplace/withWord
in the line:%s/toReplace/withWord
in the file:3,4s/toReplace/withWord
between linesCntr
+r
==> redo/word
==> find a word
Visual mode
Comment in/comment out
To comment in:
Press
Esc
Press
Ctrl-v
Select lines
Press
I
Insert the character to put at the beginning of the line
Press
Esc
To comment out:
Press
Esc
press
Ctrl-v
Select lines
Press
x
Press
Esc
Select and delete
Go to the first line
V
move down to last line
d
Last updated
Was this helpful?