微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何重复Vim中的最后n个更改?

做。重复最后一次更改。执行2.重复最后一次更改2次。但想象一下,我想在最后一个之前重复这个变化,我该如何在Vim中做呢?

谢谢

不要以为你可以,见:帮助。但是,您可以做的是为您的编辑记录一个宏,您有很多寄存器可供选择{0-9a-zA-Z“}(大写或追加)。
然后使用@u用于编辑1,@t用于编辑2等。

关于录音从Best of VIM Tips的大提示

" Recording (BEST TIP of ALL)
qq  # record to q
your complex series of commands
q   # end recording
@q to execute
@@ to Repeat
5@@ to Repeat 5 times
qQ@qq                             : Make an existing recording q recursive *N*
" editing a register/recording
"qp                               :display contents of register q (normal mode)
<ctrl-R>q                         :display contents of register q (insert mode)
" you can Now see recording contents,edit as required
"qdd                              :put changed contacts back into q
@q                                :execute recording/register q

看看这些有更多的提示重复:

:&     last substitute
:%&    last substitute every line
:%&gic last substitute every line confirm
g%     normal mode repeat last substitute
g&     last substitute on all lines
@@     last recording
@:     last command-mode command
:!!    last :! command
:~     last substitute
:help repeating

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐