Question

I'm new to vim. I'm using MacVim.

I use

:set number

which shows line numbers.

I've added

set number

to my vimrc, to make show line numbers by default.

My vimrc:

no <down> <Nop>
no <left> <Nop>
no <right> <Nop>
no <up> <Nop>
ino <down> <Nop>
ino <left> <Nop>
ino <right> <Nop>
ino <up> <Nop>
set number

But line numbers don't show up.

Everything in vimrc except set number works fine. What am I doing wrong?

Was it helpful?

Solution 2

I'd comment but I'm not allowed :(

I usually have had that problem when either the file or the line is corrupted or has Ctrl characters or in someversions of Unix if there was a space in the wrong place

try :set list and make sure there isn't a Tab, missing Line Feed or something

There's a way of viewing the Control Characters that don't display in :set list but can't remember it.

Shove comes to push delete the line and the one above and below. Save and retype it andsee if it fixes it.

OTHER TIPS

Problem was that I had one .vimrc in the ~/ and one in the ~/.vim/.vimrc. The one that was in the ~/ was overriding the one in in ~/.vim/.vimrc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top