9

I am using GEDIT and I would like to have a shortcut key that allows me to tell GEDIT (on Ubuntu) to force reloading from file system the currently opened file.

How can I do that?

fabien7474
  • 441
  • 2
  • 4
  • 9
  • 1
    Actually, gedit will not automatically reload file if the file is located in network (sharing file). In my case, the file is share on MS-OS machine, accessed through smb connection. In this situation, reload or refresh button will be usefull, to tell gedit to reopen the file with single click, without the need to click file, click close and than click the name of the file in history (three times click). The drawback is, during the work, reload/refresh button can be accidentally clicked, destroying un-save work. Perhaps, additional prompt, "are you sure" can prevent that. –  Jan 28 '12 at 14:45
  • gedit already promts if there are any unsaved changes before reloading. This is really annoying and i have to resort to ctrl+w, ctrl+shift+t. – Dan M. Jul 27 '21 at 16:52

4 Answers4

5

Not forced reloading, but revert to last saved version. File/Revert.

The keystroke combination is Alt - R, R, Alt - R.

music2myear
  • 40,472
  • 44
  • 86
  • 127
W_Whalley
  • 3,422
  • 1
  • 18
  • 17
3

This functionality is not yet present in Gedit, but it's on the Requested plugins list

Kenny Rasschaert
  • 1,012
  • 8
  • 16
0

What are you trying to accomplish? If an external program touches the file, gedit will already notice that and offers to reload the file. This is the case at least with Ubuntu 10.04 LTS.

If you want to undo all the changes instead, the already mentioned File->Revert gives you the latest saved version.

Janne Pikkarainen
  • 7,715
  • 1
  • 31
  • 32
  • 4
    I assume he's annoyed about having to aim-and-click the "Reload" button in the GUI, and would rather use a keyboard shortcut for doing that action. It currently takes 7 tabs or 2 shift-tabs and an enter to switch to the correct button - a direct shortcut would be much more comfortable. – Ilari Kajaste Jul 29 '10 at 16:46
  • 1
    On my machine, gedit will not automatically notice. If you switch to a different open document, and then back, only then will it pop up to reload it. – Kevin Mills Jun 22 '15 at 21:54
-1

Try this for gedit 3.8+: https://github.com/raelgc/gedit-restore-tabs, said by author:

Upon starting Gedit, this plugin will try restore all open documents from the last Gedit window that was closed.

  • 1
    Please read the question again carefully. Your answer does **not** answer the original question. He wants to force reload the current file from disk. Nothing to do with restoring open documents or restarting gedit. – DavidPostill Jul 13 '16 at 09:12