Thursday, February 2, 2012

Re: Surround active bufer with higlight

Rich Healey <healey.rich@gmail.com> a écrit:
>
> When I have my window split with many buffers, the title line on the active
> pane is a different color, but is it possible to have all 4 borders of the
> current split different the way tmux et al does?

I don't think that's possible. However, perhaps the following (which
might be improved) will suit your needs; it uses ColorColumn to change
the background color of inactive windows (of course you'll need ColorColumn
suitably set; darker than Normal would be good, I suppose), so the
current window seems highlighted (it would be better still to set NonText
too):


function! s:SetCurrentWindow()
for i in range(1, tabpagewinnr(tabpagenr(), '$'))
let l:range = ""
if i != winnr()
for j in range(1, winwidth(i))
let l:range = l:range . j . ","
endfor
let l:range = substitute(l:range, ',$', '', '')
endif
call setwinvar(i, '&cc', l:range)
endfor
endfunction

au WinEnter * call s:SetCurrentWindow()


Best,
Paul

--
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

No comments:

Post a Comment