aboutsummaryrefslogtreecommitdiff
path: root/autoload/insert_timeout.vim
blob: 5df8b3d4124b6e08d0d76cc4d0b158013b391fc3 (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