4

How can I set check interval for set autoread option in VIM? Is it possible?

4

The autoread option does not have a timer. A reload is triggered when a shell command is launched or checktime is executed. Furthermore, vim does not have built-in timer functionality, so there's no simple way (meaning without plugins or ugly hacks) to call checktime every n seconds.

You can misuse updatetime and events like CursorHold to execute checktime when no key is pressed for the configured time. That's not exactly the solution, but it comes close.

autocmd CursorHold * checktime

Note that this autocommand only triggers in normal mode, but I would say that makes sense in this case. You don't want to auto reload while you are typing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.