Missing something?

gedit Editor Cheatsheet

A quick reference guide for the gedit text editor, covering essential commands, shortcuts, navigation, and features to boost your productivity.

Basics & File Handling

File Operations

Ctrl+N

Create a new empty document.

Ctrl+O

Open an existing document.

Opens a file dialog.

Ctrl+S

Save the current document.

Ctrl+Shift+S

Save the current document with a new name or location (Save As).

Ctrl+W

Close the current document tab.

Ctrl+Q

Quit gedit. Prompts to save unsaved documents.

Ctrl+R

Revert the current document to the last saved version.

F9

Toggle the side pane (file browser, etc.).

Basic Editing

Ctrl+C

Copy selected text.

Ctrl+X

Cut selected text.

Ctrl+V

Paste text from the clipboard.

Ctrl+Z

Undo the last action.

Ctrl+Y

Redo the last undone action.

Ctrl+A

Select all text in the current document.

Del

Delete character after cursor.

Backspace

Delete character before cursor.

Navigation

Home

Move cursor to the beginning of the line.

End

Move cursor to the end of the line.

Ctrl+Home

Move cursor to the beginning of the document.

Ctrl+End

Move cursor to the end of the document.

Ctrl+G

Go to a specific line number.

Page Up

Scroll up one page.

Page Down

Scroll down one page.

Ctrl+Arrow Keys

Move cursor word by word.

Shift+Arrow Keys

Select text character by character.

Search and Replace

Ctrl+F

Open the search bar at the bottom.

Ctrl+B

Find previous occurrence (after searching).

Ctrl+K

Find next occurrence (after searching).

Ctrl+H

Open the replace bar at the bottom.

F3

Find next occurrence of the selected text or text in the search bar.

Shift+F3

Find previous occurrence.

Alt+Enter

Find all occurrences (after search).

Search Bar Options

Case Sensitive, Whole Words Only, Regular Expressions.

Tabs, Views & Settings

Tab Management

Ctrl+T

Open a new tab.

Ctrl+Page Up

Switch to the previous tab.

Ctrl+Page Down

Switch to the next tab.

Ctrl+Alt+Page Up

Move the current tab left.

Ctrl+Alt+Page Down

Move the current tab right.

Ctrl+W

Close the current tab.

Middle Click Tab

Close a tab by middle-clicking on it.

View Options

F11

Toggle Fullscreen mode.

Ctrl+M

Toggle the bottom pane (messages, terminal, etc.). Requires plugins.

Ctrl+I

Toggle highlight mode (Syntax Highlighting).

Ctrl+L

Toggle line numbers display.

Ctrl+.

Toggle right margin display.

View Menu

Options for wrapping text, highlighting current line, highlighting matching brackets, etc.

Tools Menu

Access spell checking, sort lines, and other tool-related functions.

Document Statistics

Accessed via the Tools menu. Shows word count, line count, etc.

Preferences (Ctrl+,)

View Tab: Set options for line numbers, text wrapping, right margin, current line highlight, matching brackets, and caret blinking.

Editor Tab: Configure tab width, indentation, auto-indentation, file saving options (backup copies, trailing spaces), and line ending type.

Fonts & Colors Tab: Choose the editor font and size, and select a color scheme (syntax highlighting theme).

Plugins Tab: Enable, disable, and configure installed plugins. Essential for adding features like file browser, terminal, code snippets, etc.

Shortcuts Tab: View and customize keyboard shortcuts for various actions. You can set your own keybindings here.

External Tools Tab: Configure external commands or scripts to run from the editor (requires plugin).

Useful Shortcuts (Misc)

Ctrl+D

Delete the current line.

Ctrl+E

Clear recent documents list (under File menu).

Alt+X

Execute command (if External Tools plugin is enabled).

Ctrl+Space

Show code completion suggestions (requires plugin & language support).

F5

Reload the document if it has been changed externally.

Ctrl+Mouse Wheel

Zoom in/out text size.

Alt+Number (1-9)

Switch to the tab number. E.g., Alt+1 for the first tab.

Esc

Close search/replace bar or other transient elements.

Ctrl+P

Print the current document.

Advanced Features & Tips

Plugins & Extensions

Enabling Plugins: Go to Edit > Preferences > Plugins. Check the box next to the plugin name to enable it.

Common Plugins:

  • File Browser: Integrated file tree in the side pane.
  • Terminal: Embedded terminal panel at the bottom.
  • Snippets: Insert predefined code snippets quickly.
  • External Tools: Define and run custom shell commands.
  • Document Statistics: View document info.
  • Spell Checker: Basic spell checking.

Installing More Plugins: Some plugins are available in your distribution’s package manager (e.g., gedit-plugins package on Debian/Ubuntu). Others might be installed manually into ~/.local/share/gedit/plugins/.

Configuring Plugins: Some plugins have configuration options available by selecting the plugin in the Preferences window and clicking ‘Configure’.

Customizing UI with Plugins: Plugins can add new menu items, toolbars, side panes, or bottom panes.

Troubleshooting: If a plugin doesn’t show up, check if it’s installed correctly and if it’s compatible with your gedit version.

Performance: Be mindful that enabling many complex plugins might slightly impact startup time or performance on older systems.

Split View (Requires Plugin)

Enable the ‘Split View’ plugin in Edit > Preferences > Plugins.

Once enabled, a ‘Split View’ option will appear in the ‘View’ menu.

View > Split View > Split Vertically or Split Horizontally to split the current tab’s view.

This allows you to see different parts of the same document, or different documents side-by-side within the same tab.

Use View > Split View > Close View to close the split pane.

Navigation and editing in one pane affects the same document in the other pane (if it’s the same document).

Dragging a tab header into an existing split view can place a different document there.

Snippets (Requires Plugin)

Enable the ‘Snippets’ plugin in Edit > Preferences > Plugins.

Snippets allow you to insert predefined text chunks quickly by typing a trigger word and pressing Tab.

You can manage snippets via Tools > Manage Snippets....

Snippets are defined for specific programming languages (modes).

Example (Python snippet): Type def + Tab might insert a function definition template.

Snippet structure can include placeholders (e.g., ${1:argument}) that you can jump between using Tab after insertion.

Create custom snippets for repetitive code patterns or text.

Tips & Best Practices

Syntax Highlighting: Ensure the correct highlighting mode is selected (bottom right corner) for better readability, especially for code.

Auto Save: Configure Edit > Preferences > Editor to automatically save files periodically or create backup copies.

Trailing Spaces: Use Edit > Preferences > Editor to enable highlighting or removal of trailing spaces, which can be important for programming or consistency.

Encoding: Pay attention to the document encoding displayed in the status bar, especially when dealing with non-ASCII characters or files created on different operating systems.

External Tools: Set up external commands (like linters, formatters, or compilers) for your programming workflow if the plugin is suitable.

Shortcuts Customization: Explore Edit > Preferences > Shortcuts to customize keybindings for actions you use frequently.

Session Management: gedit remembers open tabs by default, which helps resume your work quickly after closing and reopening the editor.