How can I make Sublime Text reload the file being edited?

59,204

Solution 1

To re-load the current file, you can revert the file, either through the menu entry File | Revert File or through the command File: Revert (open the command palette by pressing Ctrl+Shift+P and type revert).

To make it easier in the future, you can bind a shortcut to the revert command, for example F5, simply by adding an entry to your key bindings (Preferences | Key Bindings - User):

{
    "keys": ["f5"],
    "command": "revert"
}

Solution 2

Although there is an accepted answer, it requires that we have to refresh manually everytime by pressing F5. Try this package Auto Refresh here. This automatically refreshes the file in x seconds which is configurable.

Solution 3

Though asked more than a year ago: you can also use "File->Reopen with encoding..." command. Note, all your changes made so far will be discarded while performing reload/revert

Share:
59,204
Mike Makuch
Author by

Mike Makuch

Updated on September 18, 2022

Comments

  • Mike Makuch
    Mike Makuch over 1 year

    How can I make Sublime Text (3) re-load the file currently being edited, to take into account changes having been made externally?

    • Admin
      Admin about 8 years
      It does automatically already. I am looking a solution to prevent it.
    • Admin
      Admin about 2 years
      @atilkan always_prompt_for_file_reload has to be set to true in settings.
  • ahnbizcad
    ahnbizcad over 8 years
    how can we do this to all files, not just individually, manually? and how can we make it do this right away, rather than having to trigger it manually after a merge or checkout?
  • Justin
    Justin about 8 years
    I'm guessing "automatic" was the original intention of the question though not explicitly stated.
  • AlikElzin-kilaka
    AlikElzin-kilaka almost 8 years
    Reverting causes the file to go blank :( Sublime build 3114.
  • Apeiron
    Apeiron over 7 years
    Right answer, but this keybind is unwise a bit
  • Matthew Woo
    Matthew Woo about 7 years
    @Apeiron why do you say the keybind is unwise?
  • poige
    poige over 6 years
    What's the point of making such a note. How do I open a door? Well, you open a door, but note the door will be open. Wow. Thanks.
  • snh_nl
    snh_nl about 4 years
    this does not reload files loaded via FTPS