TextMate Code Editor
This is kind of a silly post, but I have been using a new text editor, or what some might call a code editor. It's called TextMate, and it is only available for Mac OS X, although I am sure that there is something very similar for Windows. So far, I have been very impressed by it, as it allows for some pretty great project management. Usually I will use something like Dreamweaver or TextEdit, depending on the type of code that I am dealing with. I still rely heavily on Dreamweaver for certain things, like previewing CSS layouts and creating XHTML pages. However, as I work more and more with Ruby on Rails, I have noticed that the Terminal, TextMate, and Safari tend to be the tools I rely on. Here are a few features of TextMate that I find really helpful.
TextMate installs a UNIX command available in the Terminal called "mate". This allows it to be used to edit text files from the command line just like using "vi" or "pico". Very helpful, as it will then bring up the TextMate application and provide the same GUI that you are used to, only accessed via the Terminal. Seems like a silly thing, but it really helps out considering that most files you will need to edit from the Terminal are not accessible via the Finder.
Drag-and-Drop Project Management. You can select a series of files or a folder in the Finder, such as a directory that holds all of the files for a website or application. Once selected, those files can be dragged over the TextMate icon in the Dock (an application launching utility that is part of OS X) and it will automatically open TextMate and create a new project that contains all of those files. Much like other OSX apps, a drawer opens on the side of the main window that allows for easy navigation to files, and a single click opens them for editing. Another thing that seems simple, but once you get used to it you start to get frustrated when you have to someone open all the files individually.
Code Highlighting. This is not a unique feature at all, as tons of programs do this. However, I really like the way that TextMate handles this, as well as the ability to customize the highlighting. Created for much more hardcore (and smarter) programmers than myself, TextMate recognizes and highlights and amazing number of different languages such as PHP, Java, Ruby, C and more.
Customizable. TextMate allows you to create custom completion rules for commonly repeated tasks. Let's say that there is a particular piece of code (or a code skeleton) that you use a lot. It gets old typing the whole thing out each time, and the more that you use that piece of code the more you realize what a waste of time it is to type it out. With TextMate, you can set a custom completion rule that will complete the code for you after typing just a few characters. I haven't gotten very far into this one, but it seems like a very powerful tool, especially to serious developers and programmers.
I'm sure that there are comparable and probably better editors out there. I'm not really sure what is availble on the Windows side of the aisle, but I guarantee that there is something great out there. I suppose the main thing that I wanted to convey to people is that the tools you choose to use, and the features that they offer can often save a lot of time and energy. And who doesn't like to save time and energy, rather than becoming demotivated?
*As a little side-note to this, I wanted to mention (but forgot) that if you are using OS X and you develop websites quite a bit, one thing you will really want to do is to activate the "Debug" menu in Safari. By default this additional application menu is hidden, but it can be activated pretty easily by firing up the terminal application (located in Applications > Utilities) and entering in the following command at the shell prompt:
defaults write com.apple.Safari IncludeDebugMenu 1
Hit "Enter" and once it finishes processing (Safari should not be running, by the way) you can close the Terminal window and fire up Safari. You should see a new menu at the top next to the "Help" menu called "Debug". This puppy has some great tools in it like a DOM Tree inspector, a JavaScript console and a bunch of other little tools that make life easier when you are trying to figure out why things aren't working.
You can easily get the "Debug" menu to go away again at any time by shutting down Safari and firing up the Terminal again, this time entering:
defaults write com.apple.Safari IncludeDebugMenu 0
Notice that we simply changed the "1" to a "0", telling Safari not to display the Debug menu. Hopefully this will come in handy to someone.
This post is filed under Developers' Corner and has the following keyword tags: textmate, safari, rails.