Closed chrisfarms closed 10 years ago
Nice idea!
:sp
though, or when the same buffer is visible several times in general: syntax
is local to the buffer, and not the window.. this would need some extra handling.FWIW: I have also tried using :syntax clear
and :syntax on
, but this appears to cause more flickering and even interfered with vim-airline somehow.
I have create a new branch use-syntax
. You are welcome to test it.
There's an option to toggle this (would be off by default probably), and a another new setting (g:diminactive_use_colorcolumn
), which allows to use the syntax method only.
I should have addressed all the issues mentioned above. Turned out to be a bit more complex.. ;)
Feedback is welcome! I will probably merge it into master in the next days.
Yeah it was a tad more complex indeed ... WinEnter
seems to be a fickle event with some strange side effects ... I clearly don't fully understand the full implications of hooking it as my day of random window movements and shifting buffers has shown!
I settled for keeping it simple after the craziness got too much :)
fun! FocusBuffer()
silent! set syntax=ON
endfun
fun! DimBuffer()
silent! set syntax=OFF
endfun
augroup DimInactive
au!
au BufEnter * call FocusBuffer()
au BufLeave * call DimBuffer()
augroup END
I've installed your branch ... so will give it a day of abuse tomorrow.
I've just pushed a new commit, with major improvements/fixes. Make sure to pull any updates.
Less of an issue, and more of a recommendation.
I've found that keeping syntax highlighting enabled only for the active buffer adds greatly to the effect.
Just need to add
set syntax=ON
andset syntax=OFF
to the:Enter
and:Leave
funcs.