码迷,mamicode.com
首页 > 其他好文 > 详细

vim摘要

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

标签:c   tar   ext   a   com   string   


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摘要

标签:c   tar   ext   a   com   string   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!