Home > GNOME > How To Make The Best Of Ubuntu Text Editor (gedit)

How To Make The Best Of Ubuntu Text Editor (gedit)

I have been using Text Editor (gedit) for quite some time to take simple notes and write basic documents. Sometimes I’ll write a blog post in Text Editor to save for later, or when I’m actually able to get online. Today, however, I found that Text Editor has some great features that I was never aware of. I may even come out of my hermit-like use of vim and use this as a replacement.

/me ducks and hides from the barrage of vim lovers.

At first glance Text Editor (Applications > Accessories > Text Editor) looks like a basic text editor. Nothing fancy, nothing out of the ordinary. Some of the base features that are lacking in other editors (or have been lacking) are:

  • Tabs and Tab re-ordering
  • Spell Check
  • Document Stats (number of words, characters, etc)

Some of the awesome features that I wasn’t previously aware of however are outlined below. I hope I’m not the only person that has been in the dark about these or else I’m going to feel like quite the idiot. In any event, to find some of the cooler features you can navigate to Edit > Preferences.

The first tab you’ll see is the View tab. The default settings here are:

  • Enable Text Wrapping
  • Do not split words over two lines

The other options, and I think these would be really useful if you’re working with code are listed below. I now have activated these options:

  • Display line numbers
  • Highlight current line
  • Highlight matching bracket

It is always nice to know the line numbers within your file, particularly if you’re doing any kind of coding. Errors come up in code even for the best of us and finding the guilty line number is the key. Displaying or highlighting the current line is nice, for me, to know where my cursor is. After hours of staring at text and code some days things can become a bit of a blur. Also,highlighting matching brackets sure is nice to make sure you’ve closed that last div or ended that if statement.

The next thing that I’m really excited about is the Syntax Highlighting tab. This is on by default but you can define the language that you’d like it to specifically highlight. I saw just about everything in this list from Ada to XML. Perfect for when I’m working on PHP or perl (which I’ve just decided to try and learn).

Tomorrow I’ll outline one more of the features that really bring this editor above the rest. Enjoy the editor you never knew you had… and great work to the dev team for gedit. This is far more than I expected in a tiny, lightweight package.

If this article has been helpful, please consider linking to it.

Categories: GNOME Tags: , ,

Related Posts

  1. March 7th, 2007 at 16:21 | #1

    Don’t for get the key strokes…
    I found this one by accident…
    crtl-k inline search
    control f is nice but k comes in handy much more often for me. try it

  2. March 7th, 2007 at 16:32 | #2

    Just so you’re not tempted away from vim too much:

    * Tabs and Tab re-ordering

    :tabnew

    * Spell Check

    :set spell

    * Document Stats (number of words, characters, etc)

    :set statusline=…

    * Enable Text Wrapping

    :set wrap

    * Do not split words over two lines

    Default vim behavior

    * Display line numbers

    :set nu

    * Highlight current line

    :set cursorline

    * Highlight matching bracket

    Default in vim 7

  3. March 7th, 2007 at 16:34 | #3

    Just so you’re not tempted away from vim too much:

    * Tabs and Tab re-ordering

    :tabnew

    * Spell Check

    :set spell

    * Document Stats (number of words, characters, etc)

    :set statusline=…

    * Enable Text Wrapping

    :set wrap

    * Do not split words over two lines

    Default vim behavior

    * Display line numbers

    :set nu

    * Highlight current line

    :set cursorline

    * Highlight matching bracket

    Default in vim 7.

    Share and enjoy!

  4. March 7th, 2007 at 20:37 | #4

    Re: #2 – Ctrl-I opens a similar “go to line” box I also find very useful.

    I depend on the “Indent Lines” plugin (Enable in Edit > Preferences > Plugins). Select multiple lines and use (Shift-)Tab to (un)indent the whole lot. If the lines are tabbed irregularly, Shift-Tab will eventually bring them all flush with the left margin. Very useful when reorganizing code or formatting text!

  5. March 7th, 2007 at 22:41 | #5

    If you like gedit, I hope you tried kate during your stint in KDE.

  6. March 8th, 2007 at 08:40 | #6

    The thing I really miss from other editors (never vim) is the ability to display nonprinting characters (tab, crlf). Or are you going to tell us how to do that?

  7. JayM
    March 8th, 2007 at 12:00 | #7

    What about all the plugins?

    With plugins gedit can be a near Visual Studio clone, with Class Browser, an embedded Terminal, and File Manager pane.

    The only thing truly missing is better ctags integration so that one can highlight a function name and find the tag for it.

    There are a couple projects that claim to do this but one requires you to recompile gedit, and the other fails to initialize.

    Once there’s one you can just download then gedit will be in the big leagues!

  8. Stoffe
    March 8th, 2007 at 13:08 | #8

    Snippets. Just wish there were more by default, especially for Ruby.

  9. tenco
    March 8th, 2007 at 14:13 | #9

    > (…) with Class Browser (…)

    Never knew that such a plugin for gedit existed. o_O wow. Thanks.

  10. max
    June 4th, 2007 at 20:31 | #10

    Gedit is OK but what distrubs me about it is that it violates middle-click-paste. You can mcp selections from other programs into a gedit window, but if you select text in gedit and then try mcp it inside the gedit window, nothing happens. However, if you go to a different program, you can actually mcp the text you had selected in the gedit document. That’s just weird and frustrating.

  11. November 27th, 2007 at 12:08 | #11

    I use Gedit for web development as described here: http://www.micahcarrick.com/09-29-2007/gedit-html-editor.html

    Using plugins, I have the following features
    Work on remote files over SSH and FTP
    Snippets
    Symbol Browser Pane
    File Browser Pane
    XHTML, CSS, and PHP tag list pane
    Syntax Highlighting
    Bracket Matching
    Smart Indenting
    Tidy Validation and Cleanup

  12. January 16th, 2009 at 05:31 | #12

    What I find annoying about gedit is the fact that the tab bar is a one-liner. At least I haven’t found a way around that.
    It makes working with many open docs and specificically the switching between them difficult because you do not see all the tabs at once.

  13. Jason
    March 23rd, 2010 at 06:49 | #13

    Thanks for the tip re enabling bracket matching!

  1. March 7th, 2007 at 15:17 | #1