Gedit can be a really awesome editor if you give it a few plugins and an open mind. Here are a few of my favorites.
- MultiEdit - This bad boy lets you edit in multiple locations by only typing once. You would be AMAZED at how useful this is.
- Snippets - One of the default plugins, this one is sort of hard to explain because it does so much. It lets you create shortcuts for code that are expanded when you hit tab, but it also includes support for placeholders, wrapping text in tags, and lots of other crazy stuff.
- Zen Coding - This one’s my own, but the magic really comes from the Zen Coding library. Zen Coding lets you write a sort of HTML and CSS shorthand which is evaluated and expanded. Here’s a video to explain.
- AutoTab - A really simple plugin that tries to figure out the tab width of the current document, and sets Gedit to use that.
- Line Tools - Gives you some shortcuts to do stuff like delete current line (CTRL+D), duplicate current line (CTRL+SHIFT+D), move selected lines up/down (ALT+UP/DOWN), etc. Really, really useful.
- Save Without Trailing Space - Automatically strips any whitespace from ends of lines when you save, and can also add a blank line at the end of the file upon saving. Really useful for patches to projects like Drupal which reject patches with extra whitespace.
- Tab Switch - Lets you switch between tabs using the commonly used CTRL+TAB and CTRL+SHIFT+TAB.
- Todo - Gives you a little window that displays any TODO items in your code comments, among other keywords. Really handy for catching up on what you were working on the day before or keeping track of places to improve.
- External Tools - Gives you the ability to execute any command on the current document or selected text. The possibilities are endless with this one. Perhaps you want to validate your PHP syntax or run your HTML through HTMLTidy or check your JS with JSLint, etc.
- Pastie for Gedit - Lets you create a pastie (see http://pastie.org) out of the currently selected text. Great for sending snippets to people quickly.
Zen Coding is a pretty sweet set of tools for HTML and CSS that allows you to code things in a short of code shorthand, hit a magic button, and it expand to regular old code.
If you’re interested, here’s a demo video of it.
Sadly, there’s no official Gedit plugin for it, but Stuart Langridge hacked up a quick plugin a few months ago. However, it left a bit to be desired, and he didn’t seem to interested in maintaining it.
Therefore, I’m continuing development on it myself. I’ve fixed a few bugs and refactored a couple parts, and I’m hoping to turn this into a really nice plugin.
The code is all at GitHub, so feel free to download, drop it into your Gedit plugins folder (see the README file for more info), and try it out.
Just released an installer to be used for self-hosted CI apps. From the README:
CI Installer is a staring point for giving your downloadable CodeIgniter app an installer.
If you’re making a CI app that is designed to be downloaded and self-hosted,then you’ll need an easy way for the user to get the DB structure and config in place. That’s what this is for.
I just released a Chyrp module which implements MarkItUp’s Markdown set into Chyrp’s admin UI. It’s a really simple module and should work with Chyrp’s 2.0 release as well as the development releases at GitHub.
I’ve been using it for a couple weeks and have really enjoyed it. MarkItUp does a good job of finding a middle ground between raw code and WYSIWYG. If you’re not familiar with the editor, check out the demos.
Part of the beauty of MarkItUp is that the textarea can stay a textarea since it’s still just text. Most WYSIWYGs have to convert it to an iFrame to display bold text, italic text, images, etc., and that tends to get a bit messy and slow.
Anyways, if you’re a Chyrp user and you’re interested, check out the module. Also, here’s a screenshot:

Just thought I’d share the gEdit Color Scheme I’ve been using for awhile now. I’ve lovingly named it Flarp, in honor of this urban legend.

Installation:
- Download it.
- Put it in /home/yourname/.gnome2/gedit/styles
- Fire up gEdit and pick the theme in Edit -> Preferences -> Fonts & Colors
Enjoy!
This is one of those things that I would expect everybody to be doing by now but nobody really is.
One of the annoyances of printing is that when you print out a webpage, you can see the links but you have no idea where any of them go to. Quick fix: stick the following rules in your print stylesheet and the link’s href will be appended after it in parenthesis:
I have no idea where I first found this, so apologies to whoever first came up with it.
Say you need to grab the first paragraph of a node’s body that starts out with text. For example, you want to add a drop cap to the first letter of a node’s body, but if the first paragraph only has an image, then you can’t do anything cool like first-child. So here’s what you do.
Throw this into your theme’s template.php:
Replace THEMENAME with your theme’s name (i.e., the name of your theme folder) and you should be good to go. This just adds class=”first” to the first paragraph of your node’s body that does NOT start with an img tag.
Just thought I’d share. Larry Garfield (aka Crell aka Drupal’s DB maintainer) left an insightful comment on this blog post:
[…] That’s one of the reasons we maintain a pluggable theme layer, even if it’s not really used [i.e., everybody uses phptemplate even though it’s not the only option - Mike]. It forces us to think about how the theme system will be used and what parts of it really belong where. That’s the example, actually, that Jeff Eaton gave me over dinner one night while I was bemoaning how difficult it was to support PostgreSQL in early versions of DBTNG. :-) Just because no one uses Postgres doesn’t mean we shouldn’t still support it, because forcing ourselves to support it forces architectural decisions that improve the overall system in the first place.
And you know what? He was absolutely right. Now we have full support for 3 databases, a 4th in contrib, and the overall DBTNG [i.e., DB The Next Generation which is the D7 implementation of Drupal’s multi-database abstraction layer - Mike] architecture is much cleaner and better than it would have been otherwise.
Making something pluggable can be an excuse to force yourself to make it right. That you also enable other people to swap it out themselves (with a little or a lot of effort) for their own implementations that do things you never dreamed of is a nice side effect. :-)
This in response to the growing smallcore movement. My ramblings on that are coming soon.
I’ve been using a horrific monstrosity of a find command for this, and I just found out that grep can handle this by itself. Watch:
grep -rl 'your pattern' your_directory
For example, say you’re in the web root and you need to find every file which calls a certain function. You’d run:
grep -rl 'function_name' *
So easy. I’m so dumb.
By the way, the ‘-r’ makes it recursive and the ‘-l’ makes it just list the filename (instead of the filename and the context of the match).