Fix a small but stupid bug that the result of `timer_start` (i.e. the timer ID) was evaluated as Ex command. This would lead to a jump to the top of the file, every time the vimrc was reloaded (i.e. when a .vim is saved). Use `call` instead of `execute`, to fix this.
20 lines
545 B
VimL
20 lines
545 B
VimL
" Functions """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
" Toggle spell language between German and English
|
|
function! CycleSpellLang()
|
|
if (&spelllang == 'en')
|
|
set spelllang=de
|
|
else
|
|
set spelllang=en
|
|
endif
|
|
endfunction
|
|
|
|
" Check time every second to read file changes.
|
|
if (exists('+autoread') && &autoread)
|
|
function! CheckTime(timer)
|
|
" NOTE: silent the checktime call as it is an invalid command in the
|
|
" command line window
|
|
silent! checktime
|
|
endfunc
|
|
call timer_start(1000, 'CheckTime', {'repeat': -1})
|
|
endif
|