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

By | 2007/03/07

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.

15 thoughts on “How To Make The Best Of Ubuntu Text Editor (gedit)

  1. Pingback: Ubuntu | Christer Edwards: How To Make The Best Of Ubuntu Text Editor (gedit)

  2. Jason Brower

    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

  3. mathew

    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

  4. mathew

    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!

  5. Paul Kishimoto

    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!

  6. Yuriy

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

  7. Lane

    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?

  8. JayM

    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!

  9. Stoffe

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

  10. tenco

    > (…) with Class Browser (…)

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

  11. max

    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.

  12. Christoph Steinbeck

    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

    Thanks for the tip re enabling bracket matching!

  14. Luke

    Thanks.

    I new how to do matching brackets in the standalone SuperCollider editor on OSX but now that I have migrated to Ubuntu Studio it was a feature I was really craving within the SuperCollider enabled Gedit.

    Thanks again. 🙂

    – Luke

Comments are closed.