Gedit Text Editor

Posted on: November 19th, 2011 by No Comments

Gedit Text Editor Screenshot

Although Gedit is the default desktop text editor for Ubuntu and Gnome systems, many users are still unaware of some features Gedit has to offer. Gedit offers many of the same options found in common text editors but is expandable with the use of plugins.

Why Use Gedit?

Many users never bother to learn the shortcut keys or experiment with the preferences, but that is where the real power is unleashed. So if you want a user-friendly text editor that has lots of options and is easy to use give Gedit a try.

Installing Gedit

If you don’t have Gedit on your system you can install it from the command line using these commands.

$ sudo apt-get install gedit

Gedit Text Editor Usage


You can launch Gedit from your applications menu just find the text editor button in the accessories section. Another way to start Gedit is to just double-click on a text file. Use your menus to create new files, open files, save files, or more.

Launch Gedit

Below you can find a few commands that may help you to launch Gedit from the command line if that is what you prefer. You can use this to start a new untitled text document.

$ gedit

Open File

You can open files with this command, and if the file does not exist it will be created.

$ gedit file.txt

Gedit Text Editor Interface


The standard interface is fairly simple to use and understand. Gedit also supports basic cut, paste, undo, redo and other functions. You can also complete searches on open text files to find specific text strings.

More Interface Details

When you open a text file you will see a menu bar, a toolbar, and the text display area. There is also a status bar that will give you information and an optional side panel that is disabled by default. The side pane can display open documents and other items depending on your plugins.

Gedit Text Editor Tabs


Users can also use tabs to hold other editor windows, this works much the same way as Mozilla Firefox, and many file browsers.

Adding And Removing Tabs

You can look in the menu to create additional tabs, new files will also be opened inside their own tabs. To remove a tab simply click the close button on the right end of the open tab.

Moving Tabs

Tabs can also be moved and reordered, you can even move your tabs to a different Gedit window. Just click on the tab that you want and drag it to a new position.

Gedit Text Editor Find Text


Take advantage of the search window to find text inside your current document. You can simply type in the text that you are searching for and Gedit will highlight matching text for you.

Search Options

Some advanced search options are also available for anyone that is interested. While searching you can also cycle through text to find the next or previous matching sequence.

Gedit Text Editor Replace Text


You can also use the Gedit text editor to find and replace text inside the current text file. Replace text using the text search dialog box.

Replacing Text

You will be required to add the text that you want to search for and replace, you will also need to add to new text that will replace the old text. Users have the choice to replace only the next matching term, or you can replace all occurrences of your specified text string.

Replace Text Options

Other options are also available when using the text replace function. Users can choose to make their searches case sensitive, or you can match the entire word. You can even search for previous occurrences of a word, normally you will search forward in a document. The wrap around option is available as well. This will let you search through the entire file, back to where you started. It won’t stop when you get to the end of the file.

Gedit Text Editor Shortcut Keys


Use the next shortcut to delete the current line of text.

Ctrl + D

This lets you open a location.

Ctrl + L

Use the shortcut below to create new text documents.

Ctrl + N

This will let you select a new file to open.

Ctrl + O

The shortcut below will let you start printing the current document.

Ctrl + P

With this shortcut you can see a print preview.

Ctrl + Shift + P

The following shortcut will let you save the current file to disk.

Ctrl + S

If you want to save a file with a new filename use the next shortcut.

Ctrl + Shift + S

This will paste the current clipboard selection.

Ctrl + V

This will quit your current Gedit session.

Ctrl + Q

Use the next shortcut to close the current document.

Ctrl + W

You can select text and use this to cut the selection into the your clipboard.

Ctrl + X

Use the next shortcut will undo the last action.

Ctrl + Z

Gedit Text Editor Plugins


The functionality of the Gedit text editor can be expanded in many ways using the list of available plugins. The following plugins can be found in the Gedit plugin preferences window.

Change Case Plugin

The change case plugin will allow you to change the case of highlighted text.

Document Statistics Plugin

With this plugin you can see the number of lines, number of words, and the number of characters in your document.

External Tools

Use this plugin to execute commands directly from Gedit.

File Browser Plugin

This plugin lets you brose your files and folders from a Gedit side panel.

Indent Lines Plugin

Use this to add or remove indentations from the selected lines.

Insert Date And Time Plugin

This will add the current date and time to your documents.

Modelines Plugin

You can use this to set editing preferences for each of your documents.

Python Console Plugin

This lets you run commands in Python.

Snippets Plugin

With this you can store text snippets that you often use, and you can easily insert them into your documents.

Sort Plugin

This plugin will allow you to sort selected text alphabetically.

Spell Checker

This is a simple spell checking plugin.

Tag List Plugin

With this plugin you can add tags for HTML and other languages into your documents from a side panel list.

Gedit Text Editor Syntax Highlighting


Other Gedit options include syntax highlighting which makes code easier to read. Using syntax highlighting all code will be displayed using different colors for different parts of your code. This option can be turned on from your view menu by clicking highlight mode.

Syntax Highlighting Colors

You can also change the colors used for syntax highlighting. This took a little bit of hair pulling on my end but I finally figured it out. You will have to edit the theme file you are using for Gedit. Use the command below to edit the file, I will post advanced solutions for this soon.

sudo vim /usr/share/gtksourceview-3.0/styles/theme.xml

Tags: , , , , | Posted in Applications