3

I'd like to have line numbers permanently shown in vim, not only for regular text type files rather than for help files too.

Adding set number to the main configuration file of vim (~/.vimrc), as it is suggested in vim line numbers - how to have them on by default?, has no effect for the help file for me.

So where do I have to apply the appropriate configuration change?

Community
  • 1
  • 1
Andi Hafner
  • 311
  • 2
  • 9
  • 1
    Possible duplicate of [vim line numbers - how to have them on by default?](http://stackoverflow.com/questions/10274146/vim-line-numbers-how-to-have-them-on-by-default) – Sayse Jun 14 '16 at 07:48
  • 1
    As far I can see, it is not a duplicate, because it concerns to the help filetype and not to line numbering in general. – Andi Hafner Jul 05 '16 at 20:35

1 Answers1

12

my help shows line number by adding this line in my vimrc :

autocmd FileType help  setlocal number

It seems that you don't have to change vim's file, and don't need the root permission either.

Kent
  • 189,393
  • 32
  • 233
  • 301
  • I don't see "basic" and "advanced". I have many plugins installed, it worked for me. If some plugins leads to the line above not working, you should report bug to the plugin owner. – Kent Jun 20 '16 at 07:46
  • I have to say that I was wrong. Your solution works. I didn't remark the 'autocmd FileType' directive and confused it with the 'set number' command. So I think, we can delete these comments, as your answer is correct. – Andi Hafner Jul 05 '16 at 20:33
  • @AndiHafner if you accepted this answer, other readers know this is the solution to your problem. – Kent Jul 05 '16 at 23:25
  • Ok, thanks for your working solution and for not to bother me, even if I was wrong with my poor "solution", which required admin rights, giving me the necessary time to review the issue among ones other daily obliges... By the way: Could you explain to me why the '@User' directive doesn't work for me? I intended to address you like this, but by clicking the 'Save Edits' button, the stackoverflow webinterface deletes this entry... – Andi Hafner Jul 06 '16 at 13:17