Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Not sure if I am missing something very obvious here, but it looks like you can't set your own key bindings in gedit. I've looked around on the ubuntu support forums and Googled around, but apart from a very old and down-voted gedit plugin on sourceforge, there is nothing that allow this.

Any help will be appreciated.

share|improve this question
up vote 6 down vote accepted

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


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)

share|improve this answer
Thanks for confirming that one can't do custom key-bindings in gedit other than the menu accelerators. That is a complete show stopper for me and I'll replace gedit asap. I don't have enough reputation to up-vote you (yet). – JannieT Aug 14 '10 at 14:39
Luckily, this is not (now) the case; see Pavel's answer. – Lambart Feb 12 '13 at 1:29

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.


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

share|improve this answer
This is amazing. I accidentally lost the Ctrl+S shortcut by using it in the External Tools plugin, and was left with no way graphical way of restoring the 'save' command... even after restarting gedit! Gedit is written in C, with mostly Python based plugins... why on earth does it have a scheme keybinding file? And what other lisp-y features of it am I not aware of? – Robru Oct 9 '12 at 7:59
I've bookmarked this answer and used it to fix several systems over the years. I just tried it today with Ubuntu 14.04 and I was able to fix Ctrl-PgUp/Ctrl-PgDn, but what's strange is that although my changes persisted, gedit has overwritten the accels file with the OLD shortcuts. And I was unable to get Ctrl-Y (the most annoying, to me) to work. Anyone have any new ideas for 2015? – Lambart Feb 23 '15 at 19:01
This does not work. Gedit overwrites the accels file even if it is not running. – Genom Feb 3 at 9:47

This page's comments contain some info about changing keyboard shortcuts:

For example, you could install this plugin to edit some of them:

share|improve this answer

I wanted to know this a while back as well and eventually came across this:

Enable 'Editable menu shortcut keys' in System > Preferences > Appearance > Interface.

You can then highlight a menu entry in gedit and change its key binding by pressing the combination you want.

share|improve this answer
Thanks! I'm on Ubuntu Lucid and it doesn't have an Interface tab in the Appearance dialog. Also, even if I could make my menu shortcut key editable, it would not be much use, because there are so few commands exposed via the menu. With this method I can't set ctrl-e to delete the current line, for example. – JannieT Aug 12 '10 at 2:11

You must log in to answer this question.

protected by Community Dec 1 '14 at 13:11

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .