blob: c8de8efaa34d32c020ea2a20ecd7ec8fa15125af (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
"
" cursorline_current: If 'cursorline' is globally on, only enable it for the
" current window, and only when not in insert mode. Essentially, make
" 'cursorline' follow the actual normal-mode cursor as much as possible.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('loaded_cursorline_current') || &compatible || v:version < 700
finish
endif
let loaded_cursorline_current = 1
augroup cursorline_current
autocmd!
autocmd VimEnter *
\ if winnr('$') > 1 | call cursorline_current#Load() | endif
autocmd InsertLeave,WinEnter,FocusGained *
\ call cursorline_current#Restore()
autocmd InsertEnter,WinLeave,FocusLost *
\ call cursorline_current#Suspend()
augroup END
|