Introduction

Text Editor (gedit) is the default GUI text editor in the Ubuntu operating system. It is UTF-8 compatible and supports most standard text editor features as well as many advanced features. These include multilanguage spell checking, extensive support of syntax highlighting, and a large number of official and third party plugins.

gedit is suited for both basic and more advanced text editing and is released under the GNU General Public License.

Screenshot

gedit.screenshot1.png

Installation

gedit is located in Ubuntu's Main repository and is installed by default. gedit can be installed in Kubuntu, Xubuntu and other distributions although additional libraries are necessary and will be installed on non-GNOME systems.

To install gedit:

Opening gedit

gedit incorporates a graphical user interface (GUI) and is opened by going to ApplicationsAccessoriesText Editor or by pressing Alt+F2 and typing gedit

Command Line Tips

Opening gedit via the command line allows the user to take advantage of several options unavailable from the GUI menu. If a path is not included in the startup command, gedit will look for the file in the current directory. If the file is not found, gedit will open a blank file with the file name entered on the command line:

Configuration Options

Several popular options which the user may wish to review after the initial installation are:

Plugins

geditplugins1.png

Plugins greatly enhance the power of gedit and are are accessed via EditPreferencesPlugins. More than a dozen plugins are pre-installed and can be enabled/disabled in this section. Some of the most popular are enabled by default while others must be enabled by the user.

For descriptions of standard plugins distributed with the gedit package visit this link.

Many additional plugins are available from third-party resources. See the Links section near the bottom of this page.

Syntax Highlighting

A very useful feature of gedit is the ability to color programming code. Using syntax highlighting makes simple errors easier to recognize. gedit uses the GtkSourceView for syntax highlighting. The .lang file for a specific programing language is located in the /usr/share/gtksourceview-3.0/language-specs/ folder. These files may be edited or additional files created to further define the highlighting definitions.

Syntax highlighting is automatic and is selected in one of two methods. It can be chosen via the menu with View, Highlight Mode or via the lower statusbar. The statusbar, enabled via the View menu, displays programming language options for many types of sources, scripts, markup and scientific formats. A screenshot of the statusbar in use is located further down this page.

Using gedit for XML / Docbook XML

gedit provides a user-friendly way to make XML markup or Docbook XML for yelp and ubuntu documentation. The pictures and instructions given below use gedit 2.26.1. The recommended changes help take full advantage of the syntax color highlighting which gedit provides.

The above one is when the text is highlighted using geditdocbook. The same text when highlighted using XML looks like:

Experiment with gedit's settings and markup in general to have a feel of what works best for you.

Uninstalling gedit

If you are running Ubuntu and attempt to remove gedit via Synaptic or apt, the system will also attempt to remove the ubuntu-desktop metapackage. If you try to remove ubuntu-desktop specifically in Synaptic the user will be cautioned with:

If the user is experiencing problems with gedit, it may be preferable to first reset the user's preferences by removing the user's .config/gedit folder rather than attempting to remove the entire application and the ubuntu-desktop metapackage. Learn more about Ubuntu's MetaPackages.

Related Apps

External Links


CategorySoftwareDefault CategorySoftware

gedit (last edited 2017-03-27 03:04:35 by ip4d15fb06)