vim undo limited to one step on some hosts
Asked Answered
B

2

7

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?

Bound answered 1/2, 2012 at 6:22 Comment(0)
S
3

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.

Salutary answered 1/2, 2012 at 6:58 Comment(1)
Thanks. Deadlines don't make me think straight some times.Bound
B
4

vimrc was blank on the affected box.

I added these lines from my other dev box and everything was hapy again.

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
Bound answered 1/2, 2012 at 6:58 Comment(0)
S
3

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.

Salutary answered 1/2, 2012 at 6:58 Comment(1)
Thanks. Deadlines don't make me think straight some times.Bound

© 2022 - 2024 — McMap. All rights reserved.