Skip to content

Instantly share code, notes, and snippets.

@McFrappe
Last active February 13, 2022 18:43
Logic for entering/leaving a pane. Provides a column for active pane.
" Logic for entering/leaving a pane
function! OnWinEnter()
if exists('w:initial_cc')
let &colorcolumn = w:initial_cc
endif
endfunction
function! OnWinLeave()
if !exists('w:initial_cc')
let w:initial_cc=&colorcolumn
endif
let &colorcolumn = 0
endfunction
augroup BgHighlight
autocmd!
autocmd WinEnter * call OnWinEnter()
autocmd WinLeave * call OnWinLeave()
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment