I recently discovered the use of buffers in vim and I was wondering if it is possible to highlight the line of the current buffer in the window which show :ls
result?
I know that the current buffer is marked with %
but highlighting the line would be easier to see.
Any vim-master can give me hand with this?
There's no built-in option, so you'd either have to directly modify Vim's sources, or write a custom command in Vimscript. I would not recommend any of those.
For the latter, you can use :redir
to capture the output of built-in :ls
, split()
into lines, then :echo
each in a loop, matching with the leading %
to detect the current one, and in that case use :echohl
to change the highlighting group. The cmdalias.vim - Create aliases for Vim commands could allow you to install that new :LS
command over the built-in :ls
, but again, I think this is too cumbersome for too little effect.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With