aboutsummaryrefslogtreecommitdiff
path: root/autoload/insert_timeout.vim
blob: 8ca3e7c9a22b19ab201a0da71e4c061f17a3ea19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
" Set update time to configured variable or default 20 seconds
function! insert_timeout#Enter() abort
  let s:updatetime = &updatetime
  let &updatetime = get(g:, 'insert_timeout_duration', 20000)
endfunction

" Restore update time to its previous value
function! insert_timeout#Leave() abort
  if !exists('s:updatetime')
    return
  endif
  let &updatetime = s:updatetime
  unlet s:updatetime
endfunction