Is there a block undo in VIM?
In Vim, is there a way to开发者_JS百科 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.
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:
- http://sjl.bitbucket.org/gundo.vim/
- http://stevelosh.com/blog/2010/09/coming-home-to-vim/
- https://github.com/tpope/vim-pathogen
精彩评论