How is this line called, and how is it configured? I tried to
configure the status line, but adding laststatus=2 to .vimrc makes
_another_ line appear above it.
Thanks.
--
Dotan Cohen
Thanks, Taylor. I want to have it always show the filename, the buffer
number, and the amount of open buffers. I seems wasteful to me to put
that info on the statusline and then take up another valuable vertical
line.
One part of it is the command prompt, and you hardly can do anything
about it. But you can put info on 'ruler' that is on the right side of
command prompt setting 'rulerformat' for you preference. `help 'ruler'`
and `help 'rulerformat'` have more info on it.
Kazuo Teramoto
I don't think that's possible. The job of the status line, as you
probably have guessed, is to display that very kind of information. The
command line is, of course, primarily for typing ex commands, and any
information it displays is going to be inherently ephemeral.
That's not to say it would be impossible to write a plugin that does it,
but it would be a bit of a hack, since that's not the command line's
intended purpose.
Not sure how useful that is, but 'ruler' can be customized with 'rulerformat':
:set ls=0 ru
:set ruf=%40(%n/%{bufnr('$')}\ %f%)
:h 'ruf
only useful with one window at a time, looks like above ruler only shows the
buffer number of the bottom window.
Also the ruler's display width seems restricted.
--
Andy
Thanks. Where is the set ruf line code documented? I figured out that
the leading %40 means forty characters' width, but I would really like
to see where this syntax is documented.
I did manage to find this page:
http://vim.1045645.n5.nabble.com/listing-total-number-of-buffers-in-the-statusline-td1189645.html
That page has this code for putting the current buffer number and the
total amount of buffers in the command line:
set rulerformat=%22(%{g:zbuflistcount};%M%n\ %=%l,%c%V\ %P%)
autocmd BufAdd * let g:zbuflistcount += 1
autocmd BufDelete * let g:zbuflistcount -= 1
autocmd VimEnter * call UpdateZBufLC()
function UpdateZBufLC()
let lst = range(1, bufnr('$'))
call filter(lst, 'buflisted(v:val)')
let g:zbuflistcount = len(lst)
endfunction
It doesn't show the filename, but this is close enough. I can always
Ctrl-G when I need the filename I suppose.
By the way, when I list the buffers with :ls, I cannot select 1, 2 to
select the first, second buffers. Is there supposed to be a way to do
this? I find that typing :b3 when the buffer list is open to be a bit
long for VIM, certainly there is a shorter way!
Thanks.
Dotan Cohen wrote:
> On Mon, Feb 13, 2012 at 17:23, Andy Wokula <anw...@yahoo.de> wrote:
>> Not sure how useful that is, but 'ruler' can be customized with
>> 'rulerformat':
>> :set ls=0 ru
>> :set ruf=%40(%n/%{bufnr('$')}\ %f%)
>> :h 'ruf
>>
>> only useful with one window at a time, looks like above ruler only shows the
>> buffer number of the bottom window.
>> Also the ruler's display width seems restricted.
>>
>
> Thanks. Where is the set ruf line code documented? I figured out that
> the leading %40 means forty characters' width, but I would really like
> to see where this syntax is documented.
:help ruf
From there you are referred to
:help 'statusline'
Regards,
J�rgen
--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)
Thank you!
I must say, I very much appreciate that you show me how I should have
gotten to :help 'statusline' instead of just telling me. That helps me
help myself in the future. Have a terrific week!