Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top