1
vote
1answer
43 views

Can I recover a deleted file from .swp after auto-reloading?

This is related to, but not solved by the question “How can I recover the original file from a .swp file?”. I had two newly-created files a.txt and b.txt open in buffers. The active buffer was b.txt, ...
2
votes
2answers
45 views

Don't load undo file if it's too large in Vim 7.3+

I just copied a massive amount of text (on the order of millions of lines, I think) into a Vim register, opened a new file, pasted, and then proceeded to edit the new copy of the excerpt. Vim was ...
1
vote
1answer
46 views

Searching all versions of a file in the undo tree in VIM

Is there an easier way to find a particular change in Vim's undo tree than just looking at random old versions of the file one at a time (either using vanilla VIM commands, Gundo, or another plugin)? ...
0
votes
2answers
83 views

Is it possible to undo a :bdelete in Vim?

I've gotten used to Ctrl-Shift-T in Firefox to undo the closing of a tab, is it possible to get similar functionality in Vim? Googling didn't point me towards anything useful for this.
2
votes
2answers
167 views

Search in Vim's undo history

I have a "weird" usage pattern in vim that I often use - or have to use, depending on how you view it. What normally happens is this: I enter some text, do some editing, then remove a bit of text ...
6
votes
2answers
971 views

How do I make vim's undo buffer persistent across sessions?

When I make an edit to a file and then leave vim, I would like to be able to undo that change when I reopen it later.
19
votes
6answers
1k views

How can I discard my undo history in vim?

Undo is nice to have in Vim. But sometimes, at a known good point, I want to erase my undo history - to be able to use u to undo individual changes, but only back to a certain point. (For instance, ...
3
votes
1answer
178 views

How to ignore an autocmd in vim's undo history?

I have the following autocommand, which basically strips whitespace at the end of each line. Unfortunately, at each save, it inserts a step into the undo to jump to the beginning to the file, which is ...
1
vote
1answer
110 views

I know there's “undo” in vim. What about a “redo”?

I'm used to do ctrl+z in other editors. Sometimes when you press ctrl+z too much, you can use ctrl+y and it redo the last action. How do create this behavior in vim?
4
votes
2answers
1k views

Undo Ctrl-w in Vim

I'm a pro user of vim, however, somehow I don't seem to have definitively figured out the use of time based undo, or maybe I don't really like it. Is there a way I can undo a deletion caused by ...
5
votes
1answer
954 views

Cursor movement history in Vim

How can I restore cursor position in Vim as it was before scrolling, selecting or PgUp/PgDn? I'm tired of searching where I was before I scrolled up to look something at the top. Are there something ...
2
votes
3answers
448 views

How to rollback the edit version in VIM?

I realized I had deleted something for mistake when I typed :wq,then how can I rollback to the pre-version?Thank you!