Gedit: No more text-based editor for you!

Jack Wallen
Apr 29, 2010
Updated • Dec 5, 2012
Linux
|
12

If you have been reading Ghacks long enough you know I am partial to the Nano text based editor. For many users that editor (or one like it) is all they need. Because of the simplicity of the tools, why slow down your work with a GUI right? But for some, those GUI-less editors are a big turn off. It's like they are the command line equivalent for text editing. Fortunately, for those, there are alternatives to the text-based editor. In the next few articles I will address this by introducing you to some of the better GUI-fied text editors. In this particular instance, I will introduce you to the GNOME default editor Gedit.

Features

Although simple to use Gedit does not lack power and features. Gedit features:

  • Tools for editing source code as well as mark up languages.
  • Offers syntax highlighting.
  • Uses tabs so you can have more than one file open at a time in the same window.
  • Can edit remote files.
  • Full undo/redo support.
  • Has a flexible plugin system.
  • And much more.

So Gedit should appeal to just about any type of user - no matter your skill level. So now, let's take a look at this tool.

The GUI

Figure 1

To fire up Gedit click on Applications > Accessories > Gedit Text Editor which will quickly bring up the Gedit main window (see Figure 1). You will notice Gedit looks like your standard text editor. And with this "standard-type" text editor you could easily open any configuration file (some you will need root or sudo access in order to open). Say, for instance, you wanted to edit you wanted to edit your /etc/samba/smb.conf file with this editor. To do this you would have to open Gedit from command like so:

sudo gedit /etc/samba/smb.conf

Figure 2

The above command would allow you to enter your sudo password so you could have read AND write access to the smb.conf file. When you open such a file in Gedit, it will look like what you see in Figure 2. Using this tool will allow you to easily search the file (without using a command like grep) undo/redo any mistakes, easily copy/paste, and more.

But what of that syntax highlighting? You do not get to see it in action when editing a flat .conf file. Let's take a look at a bash script using Gedit.

Figure 3

Yes, that's correct, Gedit even does syntax highlighting for scripting. Figure 2 shows a very simple script (one that creates my .sig file for email) open using syntax highlighting for sh scripting.  When you open this file, if the syntax highlighting does not appear by default (or if you want to switch the highlighting style) you can turn it on by clicking View > Highlight Mode > Scripts > sh. If you click on View > Highlight Mode you will see the number of different types of modes available.

If you look at the Tools menu you will also notice Gedit offers a spell check, language set option, and document statistics. Finally, if you click on Edit > Preferences > Plugins you will see the available plugins for Gedit. By default Gedit ships with twelve plugins, not all of which are activated. If you want more you can search your package management system (such as Synaptic) for "gedit" (no quotes) and find more available plugins for installation.

Final thoughts

If you are one that prefers not to use text-based editors, and you use the GNOME desktop, Gedit might be just the tool for you. In the next article I will introduce you to the KDE equivalent Kate.

Advertisement

Previous Post: «
Next Post: «

Comments

  1. George said on May 6, 2010 at 8:55 pm
    Reply

    Just try Gvim. All the goodness of Vim, with a GUI.

  2. Magice said on May 3, 2010 at 2:10 am
    Reply

    *sign*

    You guys know that both VI(m) (or its derivatives) and Emacs have GUI, right?

    ‘kay, problem solved.

  3. lecksfrawen said on May 2, 2010 at 2:14 am
    Reply

    Gedit with the GMate set of plugins is a must have.
    http://github.com/gmate/gmate

    The plugins I like most are snippets, zen coding and text tools.
    Plus the collection of styles/code highlighting schemas are quite good too.

  4. public image said on April 30, 2010 at 7:51 am
    Reply

    Another good alternative for edit is ‘ notepad2 ‘ , has the same functions as gedit and already replaced the normal notepad in my windows based pc.

  5. catharus said on April 29, 2010 at 6:52 pm
    Reply

    To Jack Wallen: include Scribes in your series on GUI-fied text editors…I’m very interested to hear your thoughts.

  6. Dustin said on April 29, 2010 at 5:08 pm
    Reply

    I love gedit just for the syntax highlighting.

    I have always used gedit in Linux as it has a very similar layout/feel to my favorite Windows editor, Notepad++.

  7. Etescartz said on April 29, 2010 at 4:06 pm
    Reply

    I too am a nano user but for some stuff i need a GUI based editor. Gedit seems kind of overweight and that’s why I always remove it when i install Ubuntu. Instead i use Leafpad. It’s a lightweight app that does the job in my case.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

We love comments and welcome thoughtful and civilized discussion. Rudeness and personal attacks will not be tolerated. Please stay on-topic.
Please note that your comment may not appear immediately after you post it.