Linux Basis --- commands of vi

EDIT mode to GENERAL mode: press ESC

general mode:

CLOSE FILE

:q!    :force to close the file but not save

:wq! :force to save and close the file

:q    : close the file but not save

:wq  : save and close the file

ENTER EDIT MODE

i :insert a charactor before cursor, and enter EDIT mode

a : insert a charactor after cursor, and enter EDIT mode

o : insert a new line backward, and enter EDIT mode

MOVE CURSOR

) :cursor move to the end of line

( :cursor move to the beginning of line

G : cursor move to the last line of the file

DELETE

dd :delete the line where cursor is

D : delete the charactors in the back of cursor in a line, include the character of cursor

x,X:in the character of a line, x means "delete the character of cursor", X means "delete the character before cursor

OTHERS

u :cancel the last operation

上一篇:Java精选笔记_多线程(创建、生命周期及状态转换、调度、同步、通信)


下一篇:Selected SVN connector library is not available or cannot be loaded