VI 常用命令
上一篇 /
下一篇 2015-04-17 14:57:44 / 天气: 晴转多云
/ 心情: 平静
/ 个人分类:Linux
最近公司不是太忙,闲暇时间我就用来看linux,以前只是简单的了解了常用命令,总觉的不够用 ,希望通过这些闲时间,能够慢慢补起来。可能使用的时候不会立马想起来命令怎么敲,回来翻翻笔记,常看着,总会记住。
- 0 or home to the first character.
- $ or End to the last character.
- /word find in down
- ?word find in up
- gg to the first line of the file.
- G to the last line of the file.
- N[enter] Move done N lines
- :n1,n2s/word1/word2/g eg: :100,200s/vbird/VBIRD/g
- :1,$/word1/word2/gc 从第一行到最后一行查找word1并且替换为word2,并且每次替换前需要用户confirm是否替换
- x 向后删除一个字符 X 向前删除一个字符
- dd 删除光标所在的一整行
- ndd 删除光标向下n行
- nyy复制光标所在行的向下n行 P,p 粘贴
- u 复原前一个操作
- 【ctrll】+r 重复前一个操作
- mkdir /tmp/vitest 创建目录
- :set nu 给当前文档设置序号 set nonu
- o 在光标所在行的下一行插入 O 在光标所在行的上一行插入
- a 从光标所在位置的下一个字符插入 A光标所在行的最后一个位置插入
收藏
举报
TAG: