aboutsummaryrefslogtreecommitdiff
path: root/autoload/insert_timeout.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/insert_timeout.vim')
-rw-r--r--autoload/insert_timeout.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/autoload/insert_timeout.vim b/autoload/insert_timeout.vim
new file mode 100644
index 0000000..5df8b3d
--- /dev/null
+++ b/autoload/insert_timeout.vim
@@ -0,0 +1,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