Thursday, October 24, 2013

Essential Vim editor commands

open file

vi filename

To insert text

i insert text

Get back to reading mode

press Esc button

To save edited text file

after inserting text press Esc then 

ix

Quit a non edited file. You cant use this command if you have edited the file
:q

Quit without saving

:q!

Save and quit

zz

Delete an entire line

dd

Blank line (letter not the number)
o

Go to the beginning of the line (number not the letter)
0

Undo
u

scroll word by word
w

Scroll forward
control f

Scroll backwards
control b

Search the "word" forward
n word

Search word
/word


No comments:

Post a Comment