Can you do keyboard shortcuts in gedit?

Solution 1:

Well if you want to at least set that option so you can customise existing menu entries, run:

gconf-editor

and navigate to /desktop/gnome/interface and check the box for can_change_accels

Other than that...nope, not much you can do. (PS: I like Kate more than Gedit)

Solution 2:

Yes, you can fix these things... if you don't mind using another (any) other text editor to do it.

Note that when you make these changes, gedit must not even be running, because ~/.config/gedit/accels gets overwritten every time you exit gedit! Don't worry--once you change the shortcuts, the file will get rewritten harmlessly with your changes, though the lines may be rearranged.

Redo

To change Ctrl+Shift+Z to Ctrl+Y edit ~/.config/gedit/accels (see note below), and put this line in it:

(gtk_accel_path "<Actions>/GeditWindowActions/EditRedo" "<Primary>y")

Tab Navigation

To override tab navigation to use Ctrl+PgUp and Ctrl+PgDown, add these lines to ~/.config/gedit/accels (see note below):

(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsPreviousDocument" "<Control>Page_Up")
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsNextDocument" "<Control>Page_Down")

Then put this in ~/.config/gtk-3.0/gtk.css (to allow you override default gnome shortcuts):

@binding-set unbind-ctrl-page-up-dn {
        unbind "<ctrl>Page_Up";
        unbind "<ctrl>Page_Down";
}
GtkTreeView { gtk-key-bindings: unbind-ctrl-page-up-dn; }
GtkTextView { gtk-key-bindings: unbind-ctrl-page-up-dn; }

Note that you may have to create the gtk-3.0 directory and the gtk.css file yourself.

Restoring the 'Save' command

(see @Robru comment bellow)

  1. Close gedit.
  2. Open terminal - Ctrl+Alt+T
  3. Execute command nano .config/gedit/accels
  4. Find the following line:

    (gtk_accel_path "<Actions>/GeditWindowActions/FileSave" "")
    
  5. Comment the line (add ; at the beginning):

    ; (gtk_accel_path "<Actions>/GeditWindowActions/FileSave" "")
    
  6. Save the file:

    1. Ctrl+X
    2. Y
    3. Enter
  7. Close terminal - Ctrl+D

  8. Start gedit.
  9. ...
  10. Profit. :)

This info was taken from https://live.gnome.org/Gedit/KeyboardShortcuts

Solution 3:

This page's comments contain some info about changing keyboard shortcuts: http://live.gnome.org/Gedit/KeyboardShortcuts

For example, you could install this plugin to edit some of them: http://empty.23inch.de/pmwiki.php/Main/EditShortcuts