Search code examples
vimundoundo-redo

vim undo limited to one step on some hosts


On one of my dev machines I have unlimited undos, I can hold u and go all the way back to when I opened the file.

On another, pressing u toggles between the last two changes I made, no more.

The first dev machine I have Administrator access to and the vim installer had free reign. The second I do not and vim had to be installed off the normal OS paths and have to launch vim with a 'Sendto'. Perhaps this is related and I'm missing some rc commands. Also noticed I have to run 'syn on' to get highlighting on that box. vimrc was also blank so now I'm sure it has something to do with it.

From other threads I don't believe this is related to the persistent undo feature, but simply a .swp or ~ issue (whatever those files are used for..)

Deadlines have prompted punting what is probably a simple issue.. How do I fix this?


Solution

  • Looks like you need a vimrc file on the second box: see :he compatible-default.

    If there is no vimrc file, vim runs in vi compatible mode, and there is no syntax highlighting etc...

    Create one. Output of :version will show you more where the files are expected.

    If undo still does not work have a look at :he undo-two-ways.