Is there any console- or window-based text editor that automatically reloads file changed on disk without prompting anything?
vim can do that. Just add
~/.vimrc. (Also check out the Tail Bundle plugin.)
autoread setting applies only certain events (which can be determined by checking the help text for
:h timestamp)). To make
vim load files more frequently, there are two decent options:
- Define a function which watches for changes.
Set an autocommand such as:
au FocusGained,BufEnter,BufWinEnter,CursorHold,CursorMoved * :checktime
This will reload whenever
vimgains focus, you enter the buffer, move a cursor, idle the cursor. It won't change the current cursor position though.
emacs can also do this, if you add to your
This doesn't watch for changes either, but the following should:
This is supposed to work like
tail -f, according to the EmacsWiki.
gedit doesn't support this, I'm sure there are plenty of other GUI editors which do.
Emacs can do that for you. It is called
revert-buffer in Emacs. If you want to enable it for every file that you open in Emacs, add the following to your
For those who like something more modern, Sublime Text does this by default.
// Always prompt before reloading a file, even if the file hasn't been // modified. The default behavior is to automatically reload a file if it // hasn't been edited. If a file has unsaved changes, a prompt will always // be shown. "always_prompt_for_file_reload": false,
g/vim can do this when using this command:
:set autoread | au CursorHold * checktime | call feedkeys("lh")
(To scroll down automatically use ...
feedkeys("G") instead (but it scrolls down every visible buffer, even when split)
... you can find explanation and additional information in this stackoverflow question/answer https://stackoverflow.com/a/48296697/4940240