Quarter Life Crisis

The world according to Sven-S. Porst

« Get Your KicksMainOh the moronic »

TextMate

1808 words on

Text editors may be the software which bring up the most ‘religious’ arguments in computer users. Once people start caring about text editors at all, they start having very specific ideas about what they need. And we end up with text editors that can do very little as well as text editors that can do everything – and that includes making coffee – with very little in between.

My big problem is that I’m not an emacs person. Yeah that thing is powerful and will probably give all the modifier keys you have a good workout. But I never wanted to deeply learn a text editor, I just wanted to type stuff. I’m not usually fussy when it comes to this and I am perfectly capable of typing an e-mail in Apple’s Mail or a simple text in TextEdit. I won’t need any fancypants features for doing that, so those applications will do. In uncomfortable situations and simple edits I can even deal with pico or vi in the terminal. The latter may be the most user-hostile piece of software ever because it has no quit button but once someone explains you how its two modes work and how to save files and quit, it does the job just fine.

While I haven’t used computers long enough to consider manual work with magnets on metal platters or punching holes text editing, I once had to use edlin on MS-DOS. Which probably was the most horrific text editing experience I ever had.

At some stage, of course, you realise that simple editors may be nice but when you do something like write TeX, HTML or programming languages, a slightly more powerful editor is helpful. First and foremost syntax highlighting helps – and has been around for a long time (on the Mac even with bold face and IIRC non-monospaced fonts in applications like Think Pascal). In a next step there’s highlighting of brackets while you are typing to see whether you balanced things correctly. And, finally, an editor can know more about the language you are typing in and it can offer commands to insert commonly used structures for your convenience. Soon after that people will want to start customising those commands because everybody has a different understanding of ‘commonly used’.

Although I have been a user of the rather extensible Alpha editor on the classic Mac, I never grew quite comfortable with the vast customisability and extensibility. And when switching to OS X I settled for using TeXShop instead. Apple’s developer tools come with their own editor that wasn’t brilliant but did the job (and had a convenient ‘compile’ button right there…) and I can’t even remember what I used for HTML editing right after switching to OS X.

As time went on I stuck to TeXShop – learning to love its lack of progress as well as bugs – but discovered SubEthaEdit (né Hydra) and was rather happy with that (all the Cocoa goodness + command line tool + syntax highlighting + change highlighting + document sharing). Then Coda came along and I started to use that for remote file editing because it’s nice for that and has quite good autocompletion (but with its huge windows and lack of Mac support or command line tool isn’t that great for local editing). Which means that I ended up being a bit screwed because there are just too many text editors on my system – each with its own set of strengths and weaknesses –  which I find confusing.

TextMate Icon After seeing TextMate’s creator Allan Odgaard speak about TextMate on the C4 video, I at least wanted to know what the fuss is about and thought I’d try TextMate as an editor. From a distance I suspected that TextMate is ‘too emacsish’ to please me. Too many options, too well hidden, too powerful for little Sven. And too much DIY required to get things working ‘just right’.

The suspicion turned out to be essentially right. I don’t think TextMate is a particularly good Mac citizen. Not just because it doesn’t display Finder labels in its file listings (Coda doesn’t do that either, what’s wrong with those text editor makers?), but mainly because it is very keyboard focused. In fact so keyboard focused that I found it rather hard to even find the commands it had. Which to me is a bit like subverting the whole idea of discoverability that gave us graphical user interfaces to begin with.

In my initial struggle several people pointed me to the somewhat amusing – and to the non-initiated non-self-descriptive – ‘Select Bundle Item…’ command. It lets you search through all the commands provided to TextMate by plugins (in a way that’s a bit better than that provided by X.5’s Help Menu). That may be brilliant for long term users but it was rather useless for novices like myself as I didn’t know which commands existed and how they were named. And that menu item is the top-most-, most important-one in the ‘Bundles’ menu (what a name?!).

I also failed to understand why, when editing a TeX document, for example, I always had to navigate into a submenu – of either the ‘Bundles’ menu or a submenu of a menu that appears when clicking a tiny button (about a third as important as setting the ‘Tab Size’ if size is anything to go by) at the bottom of the editor window – just to use a command directly relevant to the mode I am currently working in. For such an essential action this seems overly complicated and inforced the ‘emacsish’ and ‘too keyboard-focused’ impression I had.

I didn’t take notes, so I’m sure I missed a few more points which I sighed about while trying to use the editor, but a few of them stuck anyway: Be it that using italic styling in small font sizes generally is a bad idea if you like things to remain legible. Be it because I thought that the syntax highlighting was a bit slow at times. Be it the inability to mark my changes in a file, the lack of split views, the inability to drag tabs out of a window (or simply the skill to hide those abilities from me). The separate window for the find feature drove me nuts as well as I got addicted to ISIM crack many years ago and Coda luckily went with a similar idea. At the end of the day there are too many things I didn’t like in the editor.

But in a way that’s a shame because TextMate comes with a number of very cool and useful features. While I don’t really approve of it, the customisation certainly is one of them. Particularly because it is reasonably easy to add your own commands to those already defined by the application and its plugins – even I could do it. Neither the process nor result were particularly pretty but it did the job.

Then, the code folding is certainly a nice thing to have. I don’t think I would use it frequently but sometimes it’s very handy. The same holds for the editor’s ability to keep a clipboard history for you. The lack of speed in syntax highlighting I perceived certainly came with the advantage of giving good results. A particularly good use of that is the highlighting of wrong quote usage in LaTeX mode:

Highlighting wrongly used quotes.

Nanny-text editor, perhaps, but useful nonetheless and quite precise as well. The next thing worth mentioning is autocompletion which has a few nifty tricks up its sleeve. One is mapping the autocompletion keystroke to the escape key (rather than option-escape or F5, the two usual combinations which are pretty inconvenient on a laptop keyboard). While not as fancy as Coda’s autocompletions which pop up in a menu, TextMate just cycles through the available options and provides the shift-escape key combination for cycling backwards. In practice I found or at least perceived this as faster and more convenient than using a menu. The autocompletion seems to work based on the context you are in and it worked quite well for me as long as I wanted to complete terms without a hyphen or so in them.

But there are also more advanced things which I’d call ‘completions’ in some sense. At a basic level, typing something like a { will automatically insert a } for you. Many editors do that these days which is sometimes great and at other times infuriating. But TextMate has some extra smarts up its sleeves. For example when starting to write a CSS selector and hitting return after that { after which the matching } was automatically inserted, TextMate does just the right thing™, by moving the closing } two lines down and putting the cursor in an indented position in the blank line in the middle. Excellent:

TextMate CSS completion magic

Along with that it’s worth mentioning that many of the TextMate modes also come with commands to just re-style a document. Meaning that if you receive (or wrote!) a shoddy CSS or TeX file which is hard to read, using a single command can improve the situation dramatically.

Another neat feature is the ability to insert something you type several times for a single keystroke. That’s useful when typing LaTeX environments, for example. You’ll type ‘begin’ and then the tab key and TextMate will convert it into a pair of \begin{} and \end{} commands with the genius being that you can then type the environment’s name and it will appear inside both brackets simultaneously.

TextMate Autocompletion for LaTeX environments

Speaking about TeX, TextMate also comes with a very interesting (but not particularly practical) way of running TeX: Rather than displaying the full ugly TeX log output to you, the LaTeX Mode makes the brave attempt of parsing the output and filtering out the relevant information. The implementation isn’t perfect, but it illustrates that TeX output doesn’t need to be ugly and hard to read and that the front end you are using can try to get just the relevant information to you. [Compare with the dedicated TeX front end TeXShop for which people have to hack things to get semi-ugly output.]

LaTeX output window in TextMate

Despite those features, I am left with the feeling that TextMate just isn’t made for people like myself but more for people who only dislike emacs because it runs in a terminal window rather than disliking it more profoundly.

So I’ll just sit back and hope that the editors I am using will improve over time and pick up a few of the neat tricks. So, hello Coding Monkeys, what about some of these niceties? And hello Panic people, what about giving the monkeys some bananas to make sure you’ll get their improvements as well? KTHXBYE.

[Waiting for people to tell me that emacs did all this and more since ca 1789 already…]

May 8, 2008, 8:52

Tagged as software.

Comments

Comment by LKM: User icon

Personally, I mainly use BBedit for heavy-duty code writing, and ForgEdit as a smaller, quick-to-start text editor. I recommend both :-)

May 8, 2008, 13:19

Comment by ssp: User icon

@LKM:
There may have been something going for BBEdit in the classic days, but I never liked it. Never heard of the other editor, probably I’m just using TextEdit for that purpose.

I have a little theory forming by which I simply prefer text editors with a green theme to their icon… at least that would neatly explain my preferences and dislikes so far.

May 8, 2008, 13:40

Comment by Jacob Rus: User icon

TextMate does have an ISIM-like incremental search (indeed, it even uses the same names as the selectors so your custom key bindings for ISIM will work out properly).

I definitely agree that the menu organization, etc. needs improvement. Hopefully TM 2 (due out sometime in the hazy indefinite future) will be a vast improvement in this area.

When you say that “Neither the process [of customizing TM] nor result were particularly pretty but it did the job” what exactly do you mean? I find the process relatively straight-forward and the result indispensable.

August 25, 2008, 11:45

Comment by ssp: User icon

@Jacob Rus:

TextMate does have an ISIM-like incremental search (indeed, it even uses the same names as the selectors so your custom key bindings for ISIM will work out properly).

Good to know. Probably makes my point about things being hard to discover.

When you say that “Neither the process [of customizing TM] nor result were particularly pretty but it did the job” what exactly do you mean? I find the process relatively straight-forward and the result indispensable.

In a way it is, but I had the bad feeling that I’m really just fiddling around with things I don’t understand properly there. In particular, I wasn’t exactly sure what my additions could break and how easily I’d lose them when upgrading the application as I simply added commands to an existing mode. When using the editor for more than a test, I’d expect to be totally sure that none of my work gets lost. That much for the process. Obviously the result wasn’t pretty because scripting languages and myself were involved.

August 25, 2008, 13:31

Add your comment

« Get Your KicksMainOh the moronic »

Comments on

Photos

Categories

Me

This page

Out & About

pinboard Links

♪♬♪

Received data seems to be invalid. The wanted file does probably not exist or the guys at last.fm changed something.

People

Ego-Linking