gedit is the default text editor used in Ubuntu. If you're used to Notepad in Windows — or WordPad, if you need a bit more advanced capabilities, or even TextPad if you've downloaded that — then you'll be pleasantly surprised by the functionality offered in gedit.



Whether you're a computer programmer, a business analyst, a home user, or any other type of user, from time to time you're going to need some type of simple text editor. There's a place for the word processor, like Writer, but there are also times when you don't need all of that functionality, and just need to do something simple. And, of course, there are times when you need to do something that a word processor is not well-suited for; maybe editing an XML document, or working with raw HTML. (Writer can spit out HTML, too, but sometimes you need to work with the HTML code, not just a word processor that can output HTML.)

In Windows, that role is usually played by Notepad. Because Notepad was purposely built with very little functionality, it's a light-weight, fast-loading application. However, people often need a bit more functionality, which is why TextPad is so popular — especially among programmers. It's still a fairly light-weight application, but it also features things like colour-coding, spell-checking, regular expression capabilities, etc.

For Ubuntu, the text editor installed by default is gedit. (I believe gedit is short for “GNOME edit.”) By default, gedit is a very simple text editor — although it has more features than Notepad — but it also has some plugins which can be enabled, to give it even more functionality. Users familiar with the extra capabilities provided in TextPad will be right at home in gedit.


The following sections outline some of the features provided by gedit.


If you're used to Notepad, then you'll know that it can only deal with one text file at a time. If you need to edit two files simultaneously, then you need to open two instances of Notepad. TextPad can edit more than one document, and uses a tabbed interface for the multiple documents, similar to the tabs in Firefox.

gedit uses the same tabbed interface that TextPad uses. This means that it's much easier to edit more than one document at the same time, within the same gedit window. (Of course, if you wish to open multiple instances of gedit, you can do that, too.)


To switch to any of the files/documents you're editing, simply click its tab. When you're done with a particular file/document, you can close it by clicking the X on its tab.

If you have two instances of gedit open, you can drag a tab from one instance to another, to move that document to the other instance of gedit. You can also drag a tab to the desktop, which will open a new instance of gedit, and move the file/document to that new instance.

Syntax Highlighting


A feature many people find very useful in a text editor is syntax highlighting. This is a feature whereby certain text will be shown in different colours, or bolded or italicized, depending on what type of text it us. For example, if you were editing an HTML document, then the HTML elements and attributes might be shown in different colours, to distinguish the HTML syntax from the actual content of the document. (The screenshot to the right illustrates this.)

There are many different types of documents, and for each type of document, there might be different things you would want to highlight; tags/attributes in HTML or XML, keywords in certain programming languages, settings and values in ini files, etc. gedit supports the following modes of syntax highlighting:

  • Source Code (Programming Languages)
    • Ada
    • Boo
    • C
    • C#
    • C++
    • D
    • Fortran 95
    • Haskell
    • IDL
    • Java
    • Makefile
    • Nemerle
    • Objective Caml
    • Pascal
    • Scheme
    • SQL
    • VB.NET
    • Verilog
    • VHDL
  • Source Code (Scripting Languages)
    • JavaScript
    • Lua
    • Octave
    • Perl
    • PHP
    • Python
    • R
    • Ruby
    • sh
    • TCL
  • Markup Languages
    • HTML
    • LaTeX
    • Texinfo
    • XML
  • Others
    • ChangeLog
    • CSS
    • .desktop
    • Diff
    • gettext translation
    • GtRC
    • .ini
    • MSIL

You can switch the syntax highlighting to the mode you want using the View->Highlight Mode->Category->Sub-Category menu, although you don't normally have to, since gedit is very good at figuring out what type of file you're editing and choosing the appropriate form of syntax highlighting for you.

You'll also notice that you can turn highlighting off, if this is a feature that doesn't appeal to you.

Line Numbers

Many times, when working with text files, you need to know what line you're working with. A common example is if you are reading a log file of some sort, and have been told that there is an error on line X; you need to somehow find line X in that document.

If you wish, you can have gedit show the line numbers for a document.


This feature is turned off, by default, but you can start showing line numbers by going to Edit->Preferences, and checking the Display line numbers checkbox. And, of course, clearing this checkbox will turn the feature back off again.

Word Wrap

Another extremely common feature — one so common that even Notepad supports it — is the ability to “wrap” long lines of text, so that they don't scroll off to the right of the window. Word wrapping can make a document more readable — or it can make it less readable, depending on what type of text you're working with. (e.g. a pure text document might be more readable with word wrapping turned on, whereas a file containing programming source code would usually be more readable with the word wrap turned off, because for many programming languages it's important to see exactly where the newlines are.)

Unfortunately, turning word wrapping on or off is not as easy to do in gedit as it is in any other text editor I've worked with; you have to go to Edit->Preferences, and check or uncheck the Enable text wrapping checkbox. (It would be preferable to have a button in the button bar, to turn this feature on or off. Even Notepad makes it easier than gedit, with the Format->Word Wrap menu item.)

There is another option, in gedit's preferences, where you can prevent gedit from breaking up a word when text wrapping. For example, with this feature turned off, a long sentence might end up looking like this:

this is a very lo
ng piece of text

whereas with the feature on, gedit would intelligently bring the entire word “long” to the next line, like this:

this is a very
long piece of 

Search, and Interactive Search

As with most other text editors, you can search for a piece of text within your file/document by pressing Ctrl+f or using the Search->Find menu. This will bring up a Search dialog, where you enter in the text you're looking for. There are some extra options you can use to refine your search:

  • you can do a case-sensitive search, meaning that if you search for “the” gedit would not return “The” as a search result, because the first letter is capitalized
  • you can tell gedit to only match on the entire word; for example, if you search for “the” gedit would not return “thesaurus” as a search result

There is also a Replace function, which works very similar to the Find function, by pressing Ctrl+h or using the Search->Replace menu. This is used to find a certain piece of text, and replace it with a different piece of text.

There is also an “incremental search,” which Notepad users might not be used to. (However, Firefox users would be used to this functionality.) If you press Ctrl+k or use the Search->Incremental Search… menu, gedit will bring up a textbox, where you can start entering the text you're searching for. As you enter each character, gedit will refine its search of the document, highlighting every match. For example, if you search for “the” you would first type ‘t’, and gedit would highlight every ‘t’ in the document. You would then type the ‘h’, and gedit would highlight every occurrence of “th” in the document. Finally, when you type the ‘e’ gedit would highlight every occurrence of “the” in the document.


In addition to the “core” features mentioned above, gedit comes with some additional plugins, that can be enabled, for additional functionality. Some of these plugins are enabled by default, but some of the others might be just as useful to you.

To turn a plugin on or off, to go Edit->Preferences, and go to the Plugins tab. There will be a list containing each available plugin, and a checkbox which can enable/disable it.

I won't discuss all of the plugins shipped with gedit. Just the ones I can speak intelligently about.

Change Case

This one is disabled, by default.

With the Change Case plugin enabled, gedit will add a new item to the Edit menu, which you can use to change the case (or capitalization) of a piece of text. Simply select a piece of text, and then go to Edit->Change Case->Option, to change how the text is capitalized. You have the following options:

  • ALL UPPER CASE — in other words, every character will be capitalized
  • all lower case — in other words, no character will be capitalized
  • Invert Case — any character which was capitalized will be made lowercase, and any character which is lowercase will be capitalized. For example, if you select the text “this is LaTeX” and choose this option, gedit will turn it into “THIS IS lAtEx”.
  • Title Case — will make sure that the first character of each word is capitalized, and the rest are not. For example, if you select the text “this is LaTeX” and choose this option, gedit will turn it into “This Is Latex”.

Document Statistics

This one is enabled by default.

The Document Statistics plugin is used to give a dialog box with some information — some “statistics,” if you will — about the file/document you are currently editing. To use it, simply use the Tools->Document Statistics menu. It looks like the picture below.


As shown, if there is any text selected, a second set of statistics will also be shown, just for the selected text. In this case, I had not selected any text, so this information was greyed out.

The Side Pane

There are a few plugins which will show up in a “Side Pane” — that is, a special area to the left of the gedit window. If any of these features are enabled, you'll need to show this side pane by using the View->Side Pane menu, or by pressing F9.


The Documents feature1 simply shows all of the documents you're currently editing. Clicking any document will select it in the editor window, the same as clicking the document's tab would have done.

This plugin is probably not that useful, under normal circumstances, but would become more useful if you are editing many files/documents at once, meaning that not all of the tabs are easily readable on the screen.

File Browser

This one is disabled by default. The File Browser plugin can be used to navigate around the file system, to find a file you want to open. This can be easier than using the Open dialog.

Tag List

This one is disabled by default. The Tag List plugin will be familiar to TextPad users. It provides a list of common tags (and other pieces of text) which are used in HTML, XSLT, and LaTeX.


Simply double-click any item from the side pane, and it will be inserted into the document, at the current cursor location. In some cases, it might make sense to select a piece of text, and then double-click the item. For example, if I have the text

Click this link to see my homepage

I might want to make the text “this link” into a link. I could select it, and click the Anchor URI option, which would change the text to this:

Click <A HREF=> this link </A> to see my homepage

Although this plugin can be handy, I find the Snippets plugin (described below) to be a bit more useful, and more customizable.

Insert Date/Time

This one is enabled by default. The Insert Date/Time plugin, as its name suggests, is used to insert the current date and/or time into the document, at the current cursor location. Simply use the Edit->Insert Date and Time menu, will will bring up a dialog, which will allow you to choose the format in which you want the date inserted. (e.g. “Wed 03 Jan 2007 01:57:27 PM EST” vs. “03/01/07” vs. “2007-01-03 13:57:27” There are many, many options.)

Spell Checker

This one is enabled by default. The Spell Checker plugin will add spell-checking functionality to gedit. With this option on, you can easily find typos or other spelling mistakes you make while editing your documents. The functionality works very much like you're probably used to from word processors like Word or Writer, or numerous other applications which involve entering a lot of text.

Unfortunately, gedit's spell checking feature is not HTML-aware — or any other language-aware — so it will often mistake proper markup or keywords for spelling mistakes.

There are two ways you can have gedit check your spelling for you: automatically, or on demand.

You turn on automatic spell checking with the Tools->Autocheck Spelling menu item.

For some reason, the makers of gedit decided to not have the application remember this setting, so if you prefer to have gedit autocheck your spelling, you'll have to tell it so every time you open gedit.

When this option is on, any words in your file/document which gedit's dictionary doesn't recognize will be underlined in red. If you right-click any word which is underlined in red, there will be an option in the context menu called Spelling Suggestions; here, gedit will present a list of suggested words which you might have meant to type. Choose any of the selections, to have gedit replace the underlined word with the correctly spelled one. Of course, the word might actually be correct, and just not be in gedit's dictionary. In that case, you can choose the Ignore All option, which will tell gedit to stop underlining occurrences of that word. Or, if the word is one you use often, you can choose Add, to add the word to gedit's dictionary.

You can perform an on-demand spell check by using the Tools->Check Spelling menu, or by pressing F7. (You can do this even if you have the automatic spell checking turned on.) When you do so, gedit will search through the document, looking for any misspelled words. If it finds any, it will pop up a dialog box, with the first misspelled word, and a list of suggested words it can be changed to. Similar to the menu you get when right-clicking a misspelled word for automatic checking, you can change the word, tell gedit to ignore all occurrences of the word, or add the word to gedit's dictionary. There is also the option to replace all occurrences of the word with the new word; for example, if you have been consistently misspelling the word “this” as “thsi” you can hit F7, and gedit will highlight the first occurrence of the misspelled word. If you choose the proper spelling of “this” and then use the Change All button, gedit will replace every occurrence of “thsi” with “this”.

Of course, different words are spelled differently, depending on where you live. (e.g. “humour” in Canada, vs. “humor” in America.) Since I installed the English version of Ubuntu, gedit gives me the choice of a number of English dictionaries. You can choose which dictionary you want to use by going to Tools->Set Language, and choosing the correct one for your locale.


I have not found out how to install additional dictionaries, although I assume that it's possible.


This one is disabled by default. The Snippets plugin is probably one of the more powerful plugins available for gedit, so I've put it in its own page. It is similar to the Tag List plugin, in that it is used to insert common “snippets” of text into a document. However, it works a bit differently, and is much more customizable, meaning that you can create your own snippets, or even change the way that gedit's default snippets work. See the Snippets plugin page for more information.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.