Actually, there is a way to get this effect. See @ blueyed's answer to this related question: vim are dim inactive split panels . It provides a script below, and when it is placed in my .vimrc, it reduces the background of inactive windows. In fact, this makes their background the same color specified for the colorcolumn (a vertical line indicating the desired width of the text).
" Dim inactive windows using 'colorcolumn' setting " This tends to slow down redrawing, but is very useful. " Based on https://groups.google.com/d/msg/vim_use/IJU-Vk-QLJE/xz4hjPjCRBUJ " XXX: this will only work with lines containing text (ie not '~') " from if exists('+colorcolumn') function! s:DimInactiveWindows() for i in range(1, tabpagewinnr(tabpagenr(), '$')) let l:range = "" if i != winnr() if &wrap " HACK: when wrapping lines is enabled, we use the maximum number " of columns getting highlighted. This might get calculated by " looking for the longest visible line and using a multiple of " winwidth(). let l:width=256 " max else let l:width=winwidth(i) endif let l:range = join(range(1, l:width), ',') endif call setwinvar(i, '&colorcolumn', l:range) endfor endfunction augroup DimInactiveWindows au! au WinEnter * call s:DimInactiveWindows() au WinEnter * set cursorline au WinLeave * set nocursorline augroup END endif
source share