Vim undo is limited to one step on some hosts

On one of my dev machines I have unlimited undoes, I can hold u and go back to the beginning when I open the file.

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

First development machine I have administrator access, and the vim installer is fluent. The second thing I do not need, and vim had to be installed from the usual OS paths and run vim using "Sendto". Perhaps this is related, and I'm missing some rc commands. Also noticed that I need to run "syn on" to highlight the selection in this field. vimrc was also empty, so now I’m sure it has something to do with it.

From other threads, I don’t think this is due to the permanent undo function, but just with the .swp or ~ problem (no matter which files are used for ..)

The timing was due to what might be a simple problem. How can i fix this?

+4
source share
2 answers

It looks like you need the vimrc file in the second field: see :he compatible-default .

If the vimrc file is missing, vim works in vi compatibility mode, and there is no syntax highlighting, etc.

Create. Conclusion :version will show you more where the files are expected.

If undo is still not working, look :he undo-two-ways .

+1
source

vimrc was empty in the damaged field.

I added these lines from my other dev box, and everything became unpleasant again.

 set nocompatible source $VIMRUNTIME/vimrc_example.vim source $VIMRUNTIME/mswin.vim behave mswin 
+2
source

Source: https://habr.com/ru/post/1394128/


All Articles