fixes/improvements
This commit is contained in:
parent
c3fd2d2d3b
commit
8301d70c31
|
@ -1,26 +1,33 @@
|
|||
"auto_window_settings {{{
|
||||
function! WinEnterColorColumn() abort"{{{
|
||||
function! OnWinEnter() abort"{{{
|
||||
if &buftype != ''
|
||||
setlocal colorcolumn=0
|
||||
elseif exists('b:colorcolumn_restore')
|
||||
execute 'setlocal colorcolumn=' . b:colorcolumn_restore
|
||||
endif
|
||||
if &buftype == 'terminal'
|
||||
setlocal nonumber norelativenumber
|
||||
else
|
||||
setlocal number relativenumber
|
||||
endif
|
||||
setlocal cursorline
|
||||
setlocal cursorcolumn
|
||||
endfunction
|
||||
|
||||
"}}}
|
||||
function! WinLeaveColorColumn() abort"{{{
|
||||
function! OnWinLeave() abort"{{{
|
||||
let b:colorcolumn_restore = &colorcolumn
|
||||
setlocal colorcolumn=0
|
||||
setlocal nocursorline
|
||||
setlocal nocursorcolumn
|
||||
setlocal norelativenumber
|
||||
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
|
||||
autocmd WinEnter * call OnWinEnter()
|
||||
autocmd WinLeave * call OnWinLeave()
|
||||
augroup END
|
||||
"}}} augroup auto_window_settings
|
||||
" }}} auto_window_settings
|
||||
|
|
Loading…
Reference in New Issue