重复用“.”包围。 VIM 中的命令
有没有人让 surround.vim 与 repeat.vim?
这应该使您能够使用 .
命令重复环绕插件提供的任何命令。
我认为 around.vim 应该已经内置了对重复插件的支持,所以它应该开箱即用,但我无法让它工作。
Did anybody get surround.vim to work with repeat.vim?
This should enable you to repeat any command provided by the surround plugin with the .
command.
I think surround.vim should already have built-in support for the repeat plugin, so it should work out of the box, but I can't get it to work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只是将around.vim 和repeat.vim 放入我的.vim/plugins 文件夹中并尝试一下。 对我来说,它的工作原理就像描述的那样。
您可以在不支持的函数上尝试重复命令。 在 around.vim 的文档中,它说它
并没有说所有命令都可以与repeat.vim一起使用。 例如,视觉模式的东西(选择多行并包围它们)不适用于repeat.vim
I just put surround.vim and repeat.vim in my .vim/plugins folder and tried it out. For me, it works like described.
May you try the repeat command on a function that is not supported. In the docs of surround.vim it says
It does not say that all commands work with repeat.vim. E.g. the visual mode stuff (select multiple lines and surround them) does not work with repeat.vim
你是对的。 它似乎只适用于 ds、cs 和 yss。
它也部分适用于
yse
、ysiw
、ysaw
、ys2w
。 当您重复 ysiw 命令时,它会在提示符处停止,等待您输入一种周围环境(即 b、B、r、"、t...)。不过仍然没有视觉命令。我希望将来会有添加了对其余命令的支持的版本
感谢您的回答。
You were right. It seems to only work on ds, cs and yss.
It also works, partially, on
yse
,ysiw
,ysaw
,ys2w
. When you repeat a ysiw command it will stop at a prompt waiting for you to input a type of surrounding (i.e. b, B, r, ", t...).Still no visual commands though. I hope there'll be future versions with added support for the rest of the commands.
Thanks for the answer.