I want to show all buffers' names on statusline(I use powerline). And I hope current buffer can be highlighted, while others are not. When I use :bn or :bp it highlights the changed buffer. How can I make it?
I don't know how to do such a thing with powerline, however I have come across vim-buftabline which does what you ask but with the tabline instead of the statusline.
Personally, I would forget doing this in the statusline or tabline, because it is very easy to run out of space on either line. I would also stop using :bn
/:bp
and just use :b
instead to jump directly to the buffer in question.
Behold the power of :b
:
<tab>
completion<c-d>
to list out completion:b foo
. Works great with <tab>
.:b foo*bar
or :b foo/**/bar
'hidden'
via set hidden
:b
is :sb
.A common mapping:
nnoremap <leader>b :ls<cr>:b<space>
For more help see:
:h :b
:h :ls
:h 'switchbuf'
:h 'hidden'
:h 'tabline'