vi 中常用命令技巧
2015-11-17 21:54
393 查看
vi中的命令技巧
file copy in the diffrent file:
"a9yy @don't forget the ",a is variable name,9 is copy lines ,yy is copy
"ap @don't forget the ",a is variable name,p is paste
yy @copy the current line
p @paste
dd @delete the current line
nyy @copy n lines
ndd @delete n lines
d) @Delete the beginning of the next sentence
d} @Delete the beginning of the next paragraph
"
:set nu @don't forget the :,display line numbers
:set nonu @don't forget the :,undisplay line numbers
shift + g @jump to the last line
shift + u @return last state
“^”跳转:将光标快速跳转到本行的行首字符;
“$”跳转:将光标快速跳转到本行的行尾字符;
vi 有一条命令我在这里补充下:我也是一个偶然机会才发现,确实很好用。当我们使用yy命令在在这一个文件中复制,你不能复制到其他文件中,在这里用这个技巧比用剪切板那条命令还方便。
在hello1.c中按下nyy复制你想复制的文本,然后输入命令 :e ./hello2.c 这是就跳转到了hello2.c这个文件去了,然后按下p就可以粘贴到你想粘贴的地方了。(对文本操作必须文本是才保存状态下,e 后面可以根文件的目录)
file copy in the diffrent file:
"a9yy @don't forget the ",a is variable name,9 is copy lines ,yy is copy
"ap @don't forget the ",a is variable name,p is paste
yy @copy the current line
p @paste
dd @delete the current line
nyy @copy n lines
ndd @delete n lines
d) @Delete the beginning of the next sentence
d} @Delete the beginning of the next paragraph
"
:set nu @don't forget the :,display line numbers
:set nonu @don't forget the :,undisplay line numbers
shift + g @jump to the last line
shift + u @return last state
“^”跳转:将光标快速跳转到本行的行首字符;
“$”跳转:将光标快速跳转到本行的行尾字符;
vi 有一条命令我在这里补充下:我也是一个偶然机会才发现,确实很好用。当我们使用yy命令在在这一个文件中复制,你不能复制到其他文件中,在这里用这个技巧比用剪切板那条命令还方便。
在hello1.c中按下nyy复制你想复制的文本,然后输入命令 :e ./hello2.c 这是就跳转到了hello2.c这个文件去了,然后按下p就可以粘贴到你想粘贴的地方了。(对文本操作必须文本是才保存状态下,e 后面可以根文件的目录)
相关文章推荐
- 简述Android 百分比布局支持库(android-percent-support)
- 蓝桥杯 历届试题 矩阵翻硬币
- 【计算机网络】子网掩码什么用?什么是网段?什么叫做在“同一网段”?
- EditText+ListView实现从动态显示数据库数据
- LeetCode题解——Sum Root to Leaf Numbers
- 给大家介绍点技术博客,希望对大家有帮助~
- poj2010
- Firebird 3.0 新功能
- UISegmentedControl
- LeetCode79——Word Search
- Webkit之常用对象API梳理
- hadoop——倒排索引
- Reverse Words in a String
- 【郝斌数据结构自学笔记】12-13_连续存储数组的算法演示
- JMeter处理Cookie与Session
- 【python游戏编程之旅】第二篇--pygame中的IO、数据
- 五笔字根助记词
- 五笔字根助记词
- 使用ViewDragHelper实现slidemenu
- 拓扑排序