1

I am using vim for quite some time but I think I broke my settings somehow after installing a few packages.

Let me show it with examples. In normal mode I am used to navigation like this:

Normal mode

However, when I switch to insert mode, my cursor doesn't remember it's original position anymore - note how it just keeps moving back. I am almost positive it acted differently before.

Insert mode

The most annoying thing is that it actually moves back again to fourth column when going to third line, even though I had my position at fifth column in second line, and fifth column is available in both lines.

So my question is: are there any settings that allow me to control this behavior in insert mode? My muscle memory is greatly suffering from this. I know of :virtualedit=onemore but it doesn't seem to do the trick.

  • Perhaps you have mappings for the cursor keys. Does :map <Down> show anything? – benjifisher Feb 22 '14 at 14:06
  • It's just bound to gj. – rr- Feb 22 '14 at 15:35
  • Then try :iunmap <Down>. – benjifisher Feb 22 '14 at 19:20
1

To get where you are from a standard installation do:

:set virtualedit=insert

and the cursor behaviour will be what you describe.

To get back to what you were used to:

:set virtualedit=onemore

(you missed the ':set' part in what you describe above.

Having said that: there are many reasons for not navigating through a file with arrow keys in vim. See this post on so as just one of many, many examples where people advocate using only the normal mode for navigation.

  • I have :set virtualedit= (the default, I think) and I get similar behavior in Normal and Insert modes, so I do not think that option is what matters. – benjifisher Feb 22 '14 at 14:05
  • Great! :set virtualedit=onemore worked for me. Thanks. Also... I saw "misusing vim" argument coming, but once every a few dozens edits I end up navigating in insert mode and I don't think it's that bad. I just wanted it to act like I want it to on such occasions. – rr- Feb 22 '14 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.