On Mon, Feb 13, 2012 at 17:23, Andy Wokula <[email protected]> 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.

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

http://gibberish.co.il
http://what-is-what.com

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to