28 lines
746 B
VimL
28 lines
746 B
VimL
|
"auto_window_settings {{{
|
||
|
function! WinEnterColorColumn() abort"{{{
|
||
|
if &buftype != ''
|
||
|
setlocal colorcolumn=0
|
||
|
elseif exists('b:colorcolumn_restore')
|
||
|
execute 'setlocal colorcolumn=' . b:colorcolumn_restore
|
||
|
endif
|
||
|
endfunction
|
||
|
|
||
|
"}}}
|
||
|
function! WinLeaveColorColumn() abort"{{{
|
||
|
let b:colorcolumn_restore = &colorcolumn
|
||
|
setlocal colorcolumn=0
|
||
|
endfunction
|
||
|
|
||
|
"}}}
|
||
|
augroup auto_window_settings "{{{
|
||
|
autocmd!
|
||
|
autocmd WinEnter * call WinEnterColorColumn()
|
||
|
autocmd WinEnter * set cursorline | set cursorcolumn
|
||
|
" autocmd WinLeave * setlocal colorcolumn=0
|
||
|
autocmd WinLeave * call WinLeaveColorColumn()
|
||
|
autocmd WinLeave * set nocursorline | set nocursorcolumn
|
||
|
augroup END
|
||
|
"}}} augroup auto_window_settings
|
||
|
" }}} auto_window_settings
|
||
|
|