Atom editor does not reload changed file Atom editor does not reload changed file git git

Atom editor does not reload changed file


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.

enter image description here


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 from Edit > Init.Script
  • Mac: ~/.atom/init.coffee; open in Atom from Atom > Init.Script
  • Windows: %USERPROFILE%\.atom\init.coffee; open in Atom from File > Init.Script

The keymap.cson file is located in/ can be opened from Atom via (from here):

  • Linux: ~/.atom/keymap.cson; open in Atom from Edit > Keymap
  • Mac: ~/.atom/keymap.cson; open in Atom from Atom > Keymap
  • Windows: %USERPROFILE%\.atom\keymap.cson; open in Atom from File > Keymap