Wikia

Vim Tips Wiki

Talk:Display line numbers

Back to page

1,622pages on
this wiki

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)

Around Wikia's network

Random Wiki