Fandom

Vim Tips Wiki

Talk:Display line numbers

Back to page

1,624pages on
this wiki
Add New Page

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Is there a way to not count blank lines? Edit

i.e. this:

 1 
 2 #include <stdio.h>
 3 
 4 struct date
 5 {
 6        int year;
 7        int month;
 8        int day;
 9 };

would instead read as:

 1 #include <stdio.h>
  
 2 struct date
 3 {
 4        int year;
 5        int month;
 6        int day;
 7 };

31.205.10.211 02:45, February 7, 2014 (UTC)Hugh

Nope. That can't be done without inserting actual line numbers into a buffer somewhere. --Fritzophrenic (talk) 14:31, June 17, 2016 (UTC)

27.186.127.223 03:37, June 17, 2016 (UTC)

I have set `set nu` in my vimrc and I can see the line number in general file.

But when I start a `help` file such as: `:h autocmd`, the new help buffer does not contain line number.

Is there a way to show line number automatically in the help buffer?

Thanks. ;-)

I'm not sure why they turn off in the help buffer. But you can turn them back on with an autocmd, for example:
au BufRead * setlocal number
--Fritzophrenic (talk) 14:31, June 17, 2016 (UTC)

Also on Fandom

Random Wiki