0

For some reason, Vim (gVim for Windows) turns off the line numbers when I enter insert mode. This can be rather jarring, because it shifts all the code to the right or left when I leave or enter insert mode - and I do this quite often.

Any ideas to how to keep line numbers (relativenumber, to be exact) on regardless of mode.

Key: [] : cursor | : cursor in insert mode

Normal mode

2 for(i = 0; i < something; i++) {
1    // some code here
0    // I am her[e]
1    // some more code

Insert mode

for(i = 0; i < something; i++) {
   // some code here
   // I am her|e
   // some more code
3

It sounds like some script or plugin somewhere is trying to be helpful. You can probably determine what it is with this command:

 :verbose autocmd InsertEnter,InsertLeave

This should list the events defined and the files that defined them. What you do at that point depends on whether you want to keep the script/plugin and just configure/modify it, or remove it entirely.

  • Ah ok, thanks for this. I'll look into the offending plugin to see what the deal is (looks to be numbers.vim) – funseiki Jul 7 '14 at 20:32

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.