Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Vim 中,有没有办法选择一个文本块并使用 undo 只撤消对该文本块的更改?
假设我重写了一个函数,然后在我的文件的其他地方进行一些更改。后来,我意识到我的第一个函数实现确实更好。我想撤消我在该函数中所做的更改,但保留我后续添加的内容。
我不知道这是否可能,但我经常发现自己想要这个功能。
目前...没有。Vim 7.3 具有可以遍历的撤消分支,但据我所知,Vim 在撤消期间不会注意任何选定的文本。
也许是这样: