aboutsummaryrefslogtreecommitdiff
path: root/plugin/cursorline_current.vim
blob: f7298b3e281c981c80b13d6be3248bdce35cb682 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
if exists('loaded_cursorline_current') || &compatible || v:version < 700
  finish
endif
let loaded_cursorline_current = 1

augroup cursorline_current
  autocmd!
  autocmd BufEnter,FocusGained,InsertLeave,WinEnter *
        \ let &l:cursorline = &g:cursorline
  autocmd BufLeave,FocusGained,InsertEnter,WinLeave *
        \ let &l:cursorline = 0
  autocmd VimEnter *
        \ windo doautocmd WinLeave
  autocmd VimEnter *
        \ 1 windo doautocmd WinEnter
augroup END