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)
- Close gedit.
- Open terminal - Ctrl+Alt+T
- Execute command
nano .config/gedit/accels
-
Find the following line:
(gtk_accel_path "<Actions>/GeditWindowActions/FileSave" "")
-
Comment the line (add
;
at the beginning):; (gtk_accel_path "<Actions>/GeditWindowActions/FileSave" "")
-
Save the file:
- Ctrl+X
- Y
- Enter
Close terminal - Ctrl+D
- Start gedit.
- ...
- 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
Related videos on Youtube
user123_456
Updated on September 17, 2022Comments
-
user123_456 over 1 year
How can I create word document and add certain elements inside so it can be downloaded or sent by an email?
What can you suggest me? Some examples? Is this doable with JavaScript or PHP?
-
Ram almost 11 yearspossible duplicate of CSS 2.1 compliant HTML to Microsoft Word conversion?
-
PiLHA almost 11 years
-
-
robru over 11 yearsThis 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?
-
Lambart about 11 yearsLuckily, this is not (now) the case; see Pavel's answer.
-
user123_456 almost 11 yearsidea is to select certain elements and use jquery to fill a div with those elements and after that export that to a ms-word
-
user123_456 almost 11 yearswhat would be a JS solution?
-
Laur Ivan almost 11 yearsfor js... apparently there's a docx.js. I don't use it myself so I can't vouch for it...
-
Laur Ivan almost 11 yearsimho you'd be better off doing the operation on server (i.e. sending the selected elements e.g. via a POST to the server and processing the request there). Doing it in the client (js) is weird as it can be a rather long operation.
-
Lambart about 9 yearsI'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 getCtrl-Y
(the most annoying, to me) to work. Anyone have any new ideas for 2015? -
Saren Tasciyan about 8 yearsThis does not work. Gedit overwrites the accels file even if it is not running.
-
Velkan about 7 years
(gtk_accel_path "<Actions>/GeditWindowActions/EditRedo" "<Primary>y")
stays in the file fine, but has no effect. -
foolo about 4 yearsI have written a plugin that fixes some keyboard shortcuts, and it can be modified for more shortcuts. See github.com/foolo/gedit_custom_keys