Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /home/robzbd/sites/blog.ubrio.us/wp-content/plugins/akismet/widget.php on line 126

Warning: ob_start(): non-static method wpGoogleAnalytics::get_links() should not be called statically in /home/robzbd/sites/blog.ubrio.us/wp-content/plugins/wp-google-analytics/wp-google-analytics.php on line 288
Making Gedit Behave Like TextMate for Linux

Making Gedit Behave Like TextMate for Linux

Before Reading…

Google has betrayed you! This post is _very_ old (2007) and I’ve lost the images somewhere along the way (as well as depreciated this blog). If you haven’t checked this already, I’d recommend using StackOverflow’s version, which is much more up-to-date (Or gedit-mate which looks actively maintained. Sorry for the trouble.

And if you have a minute, check out my new blog, which is more focused on Ruby/Rails over at Proccli.com

Heres a quick tip on how you can make Gnomes gedit behave like TextMate. If you’ve read any of my other posts you would know that I’m hopelessly hooked on TextMate — to the point where I can’t develop in any other editor. Sad, I know. This is probably the first application I’ve bought in years. After much bitching and moaning and searching for a clone on either PC or Linux, I realized that gedit has most of the functionality. The plug-ins required are disabled by default, but should come stock with it. For the sake of saying, these instructions are for Ubuntu Feisty — but shouldn’t be different on any other distro. These are my preferences, tweak them according to your taste of course.

Step 1
Under Edit->Preferences, on the View tab make your settings match these.

(Click for bigger view)

Step 2
Drop the tab size from 8 -> 4 and enable automatic indentation.

(Click for bigger view)

Step 3
The real meat and cheese. Enable the file browser pane and the snippets plug-ins. (and whatever else you may want..)

(Click for bigger view)

* Step 4 (Optional – but recommended)
This plug-in will do the automatic closing for things like “{” and quotes. Its under development, but is open source, so if you’re a python person you can hack this up for your needs.

  • Visit Gary Haran’s Gemini Plug-In Page and pickup the plugin tar.
  • Un-tar this into ~/.gnome2/gedit/plugins (you might have to create the folder)
  • Re-start gedit & enable the Gemini Plugin

(Click for bigger view)

**Note: This plug-in will output keycodes to the shell. If you run gedit a lot from the command line you may want to follow the next few steps – not that they aren’t obvious, but it’s worth it to point out.

  • Goto ~/.gnome2/gedit/plugins
  • edit gemini.py
  • on line 60 you will see something like
    print event.keyval

    – toss a “#” before that line to comment it out

  • save & close & you’re done

Other Helpful Hint(s)

  • In your ~/.bashrc setup a new alias, add:
    alias e="gedit "

    — its easier in the command line to just type “e *” than “gedit *”, but I’m really lazy.

More Resources
I didn’t really get too in depth with this yet — but people out there have made other plug-ins to nudge gedit on par with TextMate. Here are a few. I will add more if I get around to it – or if there are any comments with suggestions.




Comments

  1. jonuts May 28th

    Comment Arrow

    thanks for this. i have been getting quite pissed at the bloated IDEs that don’t even compare to TM imo!


  2. Ryan Long August 22nd

    Comment Arrow

    Ditto. Thanks so much!


  3. Bo Laurent January 22nd

    Comment Arrow

    This is really helpful, but one thing I *really* miss is textmate’s ability to run any shell command on a document or a selection, and route the output of the command to my liking (replace doc, as tooltip, in new doc, etc.)

    Whah!


  4. James T March 8th

    Comment Arrow

    Is it just me or are all the pictures gone?


  5. Isaiah August 23rd

    Comment Arrow

    The pictures are broken! I can’t make my settings ‘match these’ in step 1.


  6. Jeff Turner September 21st

    Comment Arrow

    The images are not there anymore? :(


  7. Jonathan October 25th

    Comment Arrow

    looks like a bunch of your screenshots are broken. Any chance you can put them back up?

    Thanks!


Add Yours

  • Author Avatar

    YOU


Comment Arrow




About Author

Rob Hurring

Ruby, Rails, PHP, bash... oh my!