Reputation: 2886
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?
Upvotes: 6
Views: 866
Reputation: 172510
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.
Upvotes: 4