hamwaves.com
;

Lesser-Known
gedit Keyboard Shortcuts

Serge Y. Stroobandt

Copyright 2013–2016, licensed under Creative Commons BY-NC-SA

  1. Home
  2. IT
  3. Content Writing
  4. gedit

Introduction

Once I really like GNOME’s gedit text editor, even though I have since become a Vim adept. And since the advent of the spoon-fed (i.e. nonforked) GNOME 3 debacle, I switched my desktop to XFCE. Nevertheless, gedit 3 works just fine in XFCE 4.11 regardless of the fact that gedit 3 employs version 3 of the GIMP toolkit (GTK+), whereas XFCE 4.11 still relies on GTK+ version 2.

Its plugins, both “official” and “less official” (LaTeX, collaboration,…) are what make gedit a truly complete editor; yet in a very unobtrusive way. As for eye candy, I can wholeheartedly recommend my own dark, relaxing Olvido colour scheme.

Screenshot of gedit 3.8.3 with its Oblivion colour scheme whilst writing this text in Pandoc Markdown. [Full screen]

Screenshot of gedit 3.8.3 with its Oblivion colour scheme whilst writing this text in Pandoc Markdown. [Full screen]

Shortcuts to speed

As a matter of fact, gedit happens to be the editor which I use for writing the Markdown documents that end up being converted to these web pages. I also use gedit for preparing LaTeX and ConTeXt documents.

Once one starts using gedit extensively for writing content, it becomes inevitable to learn a handful of keyboard shortcuts. Doing so will tremendously speed up work. This happens because keyboard typing is essentially a two-hands undertaking; when one hand leaves the keyboard to grab a computer mouse, the other hand will mostly remain idle. Use of the computer mouse seriously disrupts the flow of creative electronic writing.

Dispersed documentation

One might ask: “Why bother writing about gedit keyboard shortcuts? Are those items not documented?” Well, not quite. Here is where things start to get interesting. For sure, GNOME’s gedit wiki will direct you to a page with “official” keyboard shortcuts.

However, there is more to this story. As Craig Russell brilliantly pointed out, gedit uses the GtkTextView widget to display and edit text. This means there are more keyboard shortcuts at play than those documented in the gedit wiki.

Keyboard shortcuts

Here is my attempt at compiling an all-encompassing gedit keyboard shortcut list. Some key combinations were never published before. Other combinations were reordered for better comprehension. However, by no means I pretend this list to be complete. For example, there is this specification of GtkTextIter, which is a component of GtkTextView providing text manipulation. In it, sentence navigation gets mentioned. Unfortunately, key-bindings for these sentence functions are nowhere to be found… Finally, I did not include published shortcuts that failed to work in gedit 3.8.3, nor shortcuts that are specific to optionally installed plugins, unless otherwise stated.

Cursor navigation

Cursor navigation Ctrl
shortcut action
Ctrl Move the cursor forward by one word.
Ctrl Move the cursor backwards by one word.
CtrlPageUp or Home Move the cursor to the beginning of the line.
CtrlPageDn or End Move the cursor to the end of the line.
Ctrl Move the cursor to the beginning of the previous line.
Ctrl Move the cursor to the end of the next line.
CtrlI Move the cursor to a specific line number.
CtrlHome Move the cursor to the beginning of the document.
CtrlEnd Move the cursor to the end of the document.
CtrlAltPageUp Switch to the document/side pane tab to the left.
CtrlAltPageDn Switch to the document/side pane tab to the right.
Alt19,0* Jump to the 1st… 10th document tab.
AltTab Switch to the workspace application to the right.
ShiftAltTab Switch to the workspace application to the left.
CtrlAlt Switch to the workspace to the right.
CtrlAlt Switch to the workspace to the left.

Notes:

Selecting

Selecting Shift
shortcut action
ShiftCtrl Select forward by words.
ShiftCtrl Select backwards by words.
ShiftCtrlPageUp Select to the beginning of the line.
ShiftCtrlPageDn Select to the end of the line.
ShiftCtrl Select forward by lines.
ShiftCtrl Select backwards by lines.
ShiftCtrlHome Select to the beginning of the document.
ShiftCtrlEnd Select to the end of the document.
CtrlA Select all.

For selecting other custom text that can be specified by a regular expression, use the Click Config plugin. Regular expressions can match many items, but evidently not everything as regex recursion remains unavailable.

Moving

Moving Alt
shortcut action
Alt Move the selected word forward by one word.
Alt Move the selected word backwards by one word.
Alt Move the selected line up by one line.
Alt Move the selected line down by one line.

Deleting

Deleting
shortcut action
CtrlBkSpce Delete the word behind the cursor.
CtrlDel Delete the word ahead of the cursor.
ShiftCtrlBkSpce Delete from the cursor to the beginning of the line.
ShiftCtrlDel Delete from the cursor to the end of the line.
CtrlD Delete the current line.

Editing

Editing
shortcut action
CtrlX Cut the selected text or region and place it on the clipboard.
CtrlC Copy the selected text or region onto the clipboard.
CtrlV Paste the contents of the clipboard.
CtrlZ Undo the last action.
ShiftCtrlZ Redo the last undone action.
ShiftF7 Check spelling.

Special characters

On GNU/Linux machines, special characters can be entered by their UTF code using the key combination ShiftCtrlU. Finish off with Enter or Space. UTF-8 code for some of the most common special characters is listed here.

Searching

Searching
shortcut action
CtrlF Find a string.
CtrlG Find the next instance of the searched string.
ShiftCtrlG Find the previous instance of the searched string.
ShiftCtrlK Clear the search result highlighting.
CtrlH Search and replace.

Document operations

Document operations
shortcut action
CtrlN Create a new document.
CtrlO Open a document.
CtrlAltO Quickly open a document.*
CtrlS Save the current document.
ShiftCtrlS Save as a new file.
ShiftCtrlL Save all open documents.
CtrlP Print the current document.
ShiftCtrlP Print preview.
CtrlW Close the current document.
ShiftCtrlW Close all open documents.

Note:

Application

Application
shortcut action
F1 Open the gedit user guide.
F9 Show/hide the side pane.
F11 View fullscreen.
CtrlQ Quit gedit.

Olvido colour scheme

I use gedit with my own dark colour scheme called Olvido. It is almost indistinguishable from the Oblivion colour scheme, if not for the LaTeX expressions which are handled better. Reminder: “El olvido” is Spanish for “Oblivion”.

Compared to other editors

Gedit 3.10 and its commercial counterpart Sublime Text 3 can be made to act pretty much the same with the aid of plugins or packages. Nonetheless, both applications continue to suffer from a number of annoyances and glaring omissions. After extensively testing both applications in a Markdown content scenario, my personal balance eventually tipped in favour of Vim.

gedit, Sublime Text 3 and Vim compared
action gedit Sublime Text 3 Vim
Comment code CtrlM Ctrl/or7 depending on keyboard layout.
Adds an undesired space.
\cc using NERD Commenter,
,cc on non-English keyboards!
Uncomment code ShiftCtrlM ShiftCtrl/, i.e. not possible on my Swiss keyboard! \uc using NERD Commenter,
,uc on non-English keyboards!
Select between brackets & parenthesis No ShiftCtrlM vi[ and vi(
Select current word No CtrlD iw
Select current line No CtrlL V
Move (drag) current line Alt/ ShiftCtrl/ Alt/
after configuring ~/.vimrc
Delete current line CtrlD ShiftCtrlK dd
Duplicate current line No ShiftCtrlD yyp for yank line and put
Insert at beginning of current line Begin Begin I for insert
Append at end of current line End End A for append
Move (drag) text By word with Alt/
However, it performs poorly and is therefore hardly useful.
No, only by character with MoveText and therefore hardly useful! By word with Alt/,
by character with Ctrl/
after configuring ~/.vimrc
Spell check of Markdown with suggestions Yes No; fails between brackets! Yes; z= for suggestions
Spell check language persistence by file Yes No No, all configured dictionaries are used simultaneously.
Open URL No CtrlAlt with Clickable URLs gx, but it does not work with Markdown.
Enter character by UTF code ShiftCtrlU No ShiftCtrlU
Word suggestions As you type. Tab Tab with SuperTab
5
Creative Commons Licence
This work is licensed under a Creative Commons Attribution‑NonCommercial‑ShareAlike 4.0 International License.
Other licensing available on request.
GNU GPL v3
Unless otherwise stated, all originally authored software on this site is licensed under the terms of GNU GPL version 3.
cookie
This static web site has no backend database.
Hence, no personal data is collected and GDPR compliance is met.
Moreover, this domain does not set any first party cookies.

All Google ads shown on this web site are, irrespective of your location,
restricted in data processing to meet compliance with the CCPA and GDPR.
However, Google AdSense may set third party cookies for traffic analysis and
use JavaScript to obtain a unique set of browser data.
Your browser can be configured to block third party cookies.
Furthermore, installing an ad blocker like EFF's Privacy Badger
will block the JavaScript of ads.
Google's ad policies can be found here.
This page employs a Python Bottle server‑side script.
This page includes an open-source client-side script, written in Python and
transcoded by Brython to make it run as secure JavaScript in the browser.
Static XHTML generated from Markdown by Pandoc and
the GNU/Linux make, sed and gpp commands.
LaTeXmath markup rendered with MathJax.
BibTeX references are best read with JabRef.
Unattended CSS typesetting with Prince.
This work is published at https://hamwaves.com/gedit/en/.
profile for Serge Stroobandt on Stack Exchange, a network of free, community-driven Q&A sites
GnuPG
Use my OpenPGP public key to encrypt messages for:

echo c2VyZ2VAc3Ryb29iYW5kdC5jb20K |base64 -d
Last update: Wednesday, September 1, 2021.