aboutsummaryrefslogtreecommitdiff
path: root/autoload/insert_timeout.vim
blob: c3da2e6e3151f70a0ab2e2392344166dfc826520 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
" Set update time to configured variable or default 10 seconds
function! insert_timeout#SetUpdatetime() abort
  let g:insert_timeout#updatetime_save = &updatetime
  let &updatetime = exists('g:insert_timeout_duration')
        \ ? g:insert_timeout_duration
        \ : 10000
endfunction

" Restore update time to globally configured variable
function! insert_timeout#RestoreUpdatetime() abort
  if exists('g:insert_timeout#updatetime_save')
    let &updatetime = g:insert_timeout#updatetime_save
    unlet g:insert_timeout#updatetime_save
  endif
endfunction