VIM中有块撤销吗?
在 Vim 中,有没有办法选择一个文本块并使用撤消来仅撤消对该文本块的更改?
假设我重写了一个函数,然后在文件的其他地方进行一些更改。后来我发现我的第一个功能实现确实比较好。我想撤消在该函数中所做的更改,但保留后续添加的内容不变。
我不知道这是否可能,但我经常发现自己想要这个功能。
In Vim, is there a way to select a block of text and use undo to only undo changes to that block of text?
Let's say I rewrite a function, then go and make some changes elsewhere in my file. Afterwards, I realize that my first function implementation was indeed better. I'd like to undo the changes I made in that function, but leave my subsequent additions intact.
I don't know if this is even possible, but I often find myself wanting this feature.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前...不。Vim 7.3 有可以遍历的撤消分支,但据我所知,Vim 在撤消过程中不会关注任何选定的文本。
Currently... No. Vim 7.3 has undo branches that you can traverse but as far as I know Vim does not pay attention to any selected text during an undo.
也许是这样的:
Maybe this: