vim 命令

http://www.cnblogs.com/softwaretesting/archive/2011/07/12/2104435.html

 

:wq!  强制保存退出

:wq 保存并退出

ZZ 保存并退出

:q! 强制退出并忽略所有更改

:e! 放弃所有修改,并打开原来文件。

 

命令模式下:

u  撤销

Ctrl+r  重做

/:查找关键字,回车查找,n 向下查找,N 向上查找

:n 或者 nG 或者 ngg 光标移至第n行首

0:移动到行首

^:移动到第一个非空字符

$:移动到行尾

^ To the first non-blank character of the line.
|exclusive| motion.

g_ To the last non-blank character of the line and
[count - 1] lines downward |inclusive|. {not in Vi}
 

删除所有内容:(先用G转到文件尾)  :1,.d  

 

posted @ 2017-01-01 08:53  yhidr  阅读(101)  评论(0编辑  收藏  举报