Atom editor does not reload changed file
According to https://discuss.atom.io/t/auto-reload-changed-files/8451/6, FileWatcher is an Atom package which will do what you want.
A simple solution that works:
1) Just close the file being edited
2) Click "File->Reopen Last Item" to re-open it
Bingo!
For Atom versions 1.29+, you can just click "Fetch" on the bottom-right corner of the editor.
In order to manually force the reload of a file, paste the following lines in your init.coffee
file (from here):
atom.commands.add "atom-workspace", "custom:revert-to-disk", -> atom.workspace.getActiveTextEditor().buffer.reload()
In your keymap.cson
file, paste the following:
'atom-workspace': 'f5': 'custom:revert-to-disk'
NOTE: Make sure you restart Atom after applying these changes.
Whenever a file has changed and is not automatically reloaded, go to the tab and press F5. The file is immediately reverted to the disk state without prompt. So be careful, any manual changes (if any) are also irrecoverably lost, but that is the purpose of any revert-to-disk-state functionality.
The init.coffee
file is located in/ can be opened from Atom via (from here):
- Linux:
~/.atom/init.coffee
; open in Atom fromEdit
>Init.Script
- Mac:
~/.atom/init.coffee
; open in Atom fromAtom
>Init.Script
- Windows:
%USERPROFILE%\.atom\init.coffee
; open in Atom fromFile
>Init.Script
The keymap.cson
file is located in/ can be opened from Atom via (from here):
- Linux:
~/.atom/keymap.cson
; open in Atom fromEdit
>Keymap
- Mac:
~/.atom/keymap.cson
; open in Atom fromAtom
>Keymap
- Windows:
%USERPROFILE%\.atom\keymap.cson
; open in Atom fromFile
>Keymap