首页 > 其他 > 详细

vim摘要

时间:2014-05-23 22:50:16      阅读:443      评论:0      收藏:0      [点我收藏+]

The "." command is one of the most simple yet powerful commands in Vim. It
repeats the last change. For instance, suppose you are editing an HTML file
and want to delete all the <B> tags. You position the cursor on the first <
and delete the <B> with the command "df>". You then go to the < of the next
</B> and kill it using the "." command. The "." command executes the last
change command (in this case, "df>"). To delete another tag, position the
cursor on the < and use the "." command.
f<
df>
f<
.
f<
.
find first <
delete to >
find next <
repeat df>
find next <
repeat df>
To <B>generate</B> a table of <B>contents ~
???>
??>
?????????>
???>
?????????????>
??>
The "." command works for all changes you make, except for the "u" (undo),
CTRL?R (redo) and commands that start with a colon (:).
Another example: You want to change the word "four" to "five". It appears
several times in your text. You can do this quickly with this sequence of
commands:
/four<Enter>
cwfive<Esc>
n
.
n
.
find the first string "four"
change the word to "five"
find the next "four"
repeat the change to "five‘
find the next "four"
repeat the change
etc.
================================

vim摘要,布布扣,bubuko.com

vim摘要

原文:http://www.cnblogs.com/likeatree/p/3737101.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!