auto_autoread.vim : Automatically read files when they've changed. Does what 'autoread' promises.
script karma |
Rating 21/14,
Downloaded by 1125 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Martin Tournoij |
|
script type |
utility |
|
description |
- Homepage: (http://www.vim.org/scripts/script.php?script_id=5206
-----------------------------------------------------------------------------
Automatically read files when they've changed, This does what 'autoread' promises to do but doesn't do. This plugin requires `+python` or `+python3`.
The `'autoread'` setting _only_ checks if the file is changed when certain events happen (buffer is entered, focus changed, etc.). If you're not triggering those events, the buffer won't be updated. To be more precise, this is when:
- `:checktime` is used;
- a buffer is entered;
- `:diffupdate` is used;
- `:e` is issued for a file that already has a buffer;
- executing an external command with `!`;
- returning to the foreground (^Z, fg, only if the shell has job control).
And for gVim, this is also done when:
- closing the "right-click" menu (either by selecting something, or just
by closing it);
- focus is changed (this is what you already noticed);
- closing the file browsers dialog that pops up if you use "file -> open",
"file -> save as" from the menu (as well as some other places).
As you can see, this set is very limited. If you're running Vim in another window while you're doing something else somewhere else, the buffer never gets updated.
There are some other scripts/tips which promise to fix this, but all of those that I tried simply extend the list of events with `CursorMoved`, `CursorHold`, etc.
This plugin will periodically check if the file on the disk has changed with `:checktime`, It will do this even if you're not interacting with Vim at all.
|
|
install details |
|
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 18.221.40.152
|