Reputation: 161884
I :set number
in ~/.vimrc
to show line numbers. When I type :help
to view documentation, the line numbers don't show in the new window.
If I type :setl number?
, it prints nonumber
. If type :setg number?
, it prints number
.
I want to know why ~/.vimrc
doesn't work. Which script resets the local number
option?
I've checked the $VIMRUNTIME/ftplugin/help.vim
, but it doesn't reset the number
.
Currently, I'm using:
if has('autocmd')
auto FileType help set number
endif
Thanks.
Upvotes: 5
Views: 712
Reputation: 2254
After opening vim, simply type:
:auto FileType
Do you see set number
listed under help
? If not, your .vimrc is not being read.
Upvotes: 1
Reputation: 62558
I'm not sure what is the problem you're having. Numbers don't show up in help - yes, if I recall correctly that is a design decision and a feature - a good one, in my opinion, since why would one want line numbers in help files? (Okey, you could say "to quote a particular line from help file" but tags seems sufficient for that).
As far as the other thing go, when I set
setl nonumber
setg number
and open a new buffer in a split, numbers show.
If I start a new vim session, setlocal
and setglobal number
being nonumber
and set number
they're both changed.
Is this the behaviour you're having too?
Upvotes: 2