Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Since I spend a lot of time on my laptop, I've gotten used to using keyboard shortcuts for everything. I want to be able to switch from tab to tab of opened documents in gedit by pressing Ctrl+Tab and Ctrl+Shift+Tab. Are there config files I can edit or something else I can do to enable this functionality?

Alternatively, can anyone post a lits of keyboard shortcuts in gedit?

share|improve this question
2  
I don't know why the hell anyone would think ctrl+alt+pageup/down was a sane shortcut for anything, especially tab switching. – weberc2 Feb 28 at 23:35
Yeah, I prefer my shortcuts to be mostly one-handed affairs. Control-Alt things I usually reserve for user- and system- related big tasks. – WindowsEscapist Mar 1 at 14:11

2 Answers

up vote 2 down vote accepted

There used to be an option to enable editable menu accelerators for GNOME apps. The GNOME team removed the GUI for this, but at least under GNOME 2 it was still available via gconf. Recent Ubuntu versions use GNOME 3; I'm not sure of whether that still works (since GNOME 3 has migrated to dconf). I tried it in the old gconf-editor, and setting the option /org/gnome/desktop/interface/can-change-accels using dconf-editor, but it doesn't seem to work in Gedit (v3.4 on Precise).

According to Where to configure shortcut keys of Nautilus?, it doesn't work with Unity's global menu. You could load a different desktop environment and make the change there (if it works).

It may still be possible to edit the keyboard shortcuts by editing configuration files. According to a commenter on the (very outdated) Gedit shortcuts documentation page:

You don't really need a plugin to change keyboard shortcuts. This (also) works:

~/.config/gedit/accels:

; gedit GtkAccelMap rc-file         -*- scheme -*-
(gtk_accel_path "<Actions>/GeditWindowActions/DocumentsPreviousDocument"

"Page_Up") (gtk_accel_path "/GeditWindowActions/DocumentsNextDocument" "Page_Down") (gtk_accel_path "/GeditWindowActions/SearchFindPrevious" "F3") (gtk_accel_path "/GeditWindowActions/SearchFindNext" "F3")

~/.config/gtk-3.0/gtk.css:

@binding-set unbind-ctrl-d {
        unbind "<ctrl>d";
        unbind "<shift>F10";
        unbind "<ctrl>Page_Up";
        unbind "<ctrl>Page_Down";
}
GtkTreeView { gtk-key-bindings: unbind-ctrl-d; }
GtkTextView { gtk-key-bindings: unbind-ctrl-d; }

According to one commenter, Ctrl-Tab is hardcoded and cannot be rebound easily, but there is a plugin that purports to do this. To install the plugin, see How do I install a plugin for gEdit v3?.


If you're unable to get it to work, you could use a different editor that lets you edit shortcuts, such as KDE's Kate.

The list of default keyboard shortcuts in Gedit is available in the manual. Click "Help" > "Contents" > "Shortcut keys" in Gedit to access it.

share|improve this answer
Yes! Great answer! (Also great username XD) – WindowsEscapist Nov 30 '12 at 21:24
The plugin is what I want; where do I put the decompressed tar? – WindowsEscapist Nov 30 '12 at 21:41
1  
Never mind, found here – WindowsEscapist Nov 30 '12 at 21:53

For Ubuntu 12.04 and up:

Use dconf-editor instead of gconf-editor

sudo apt-get install dconf-tools

Then set dconf>org>gnome>desktop>interface>can-change-accels to true

Setting shortcuts when using global menu (which is the case in Unity):

  1. Open evince (or any app) with UBUNTU_MENUPROXY=0 evince
  2. Browse menus, hover an entry, type your shortcut
share|improve this answer
Can you explain the Unity option more? gedit doesn't have a hover-able menu option so that one can set a custom shortcut with the unity method though. – WindowsEscapist Nov 30 '12 at 21:50
In Unity, menus are in the top panel (previously named global menu) and you can't set your shortcuts with it. If it's the hover part you don't understand, 1. open gedit in terminal using UBUNTU_MENUPROXY=0 gedit, then go to the regular menu, place your mouse cursor on an entry, type your shortcut (eg Ctrl+x), then close gedit, done. – user55822 Nov 30 '12 at 22:18
But in gedit, there is no entry to switch documents, only to go to a specific document. – WindowsEscapist Dec 1 '12 at 0:48
Well nevermind .. there are Documents->Previous document and Documents -> Next entries, but ctrl+tab doesnt work, sorry. Ctrl+[twosuperior] does ... – user55822 Dec 1 '12 at 9:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.