Textpad for Mac?
October 27, 2007 5:07 PM   Subscribe

I want a text editor for Mac with auto-indent the way Textpad for PC does it, along with syntax highlighting.

Meaning if I type this:
function hello(){
print 'test';

The print 'test'; line gets auto-indented, because the line before it ended with { So the editor displays

function hello(){
print 'test';

Apparently auto-indent is not the right term for this because I have just tried several text editors which have auto-indent and they don't do this.
I tried TextMate, TextWrangler, BBedit and SubEthaEdit.

So, I want it to highlight my code (php) and indent my functions for me. I wouldn't think that would be so hard :( Being able to customize colors would be awesome too. Oh, and I'm using Leopard so it will need to work on that.

Any recommendations? Thanks!
posted by jesirose to Computers & Internet (12 answers total) 2 users marked this as a favorite
Best answer: TextMate does this. You just need to make sure you're in PHP mode. (at the bottom status bar next to "Lines: x, Column: x", click on "Plain Text" and change it to PHP.
posted by icebourg at 5:12 PM on October 27, 2007

Response by poster: Hells yeah! Now, if it's that easy in one of the free ones, I'll actually be converted to the Mac :)

Thank you :)
posted by jesirose at 5:16 PM on October 27, 2007

semi-illuterate here: doesn't bbedit does this, too?

posted by krautland at 5:20 PM on October 27, 2007

Response by poster: Looks like it's the same thing, I have to change the file type at the bottom.
posted by jesirose at 5:24 PM on October 27, 2007

smultron is a great little text editor that doesn't get the love textmate and bbedit receive. It's fine for everything I do, and it's free.
posted by tylermoody at 5:55 PM on October 27, 2007

I love Smultron, too, but it doesn't do what the OP wants.
posted by mkultra at 6:36 PM on October 27, 2007

Response by poster: Does anyone know how to make TextMate or the others default to PHP, so it will default to the type of indent I want?

Everytime I complain to my husband that I can't figure out how to do something on the mac, he says it's because it makes sense. *headdesk*
posted by jesirose at 6:51 PM on October 27, 2007

If you open up a *.php file, Textmate should automatically detect that you're writing php. Another thing that you can do if you're creating a new file is immediately saving as a *.php, *.inc, *.html, or maybe some more. Unfortunately, there's no keyboard shortcut for PHP specifically, but you can use CTRL+ALT+SHIFT+H to code in HTML mode, which is the same thing.
posted by secret.osha at 7:06 PM on October 27, 2007

give your files the .php extension and TextMate will work it out.
posted by bonaldi at 7:07 PM on October 27, 2007

Yeah just save the file and Textmate will switch to the correct profile. This works for basically everything, and is a good way of making sure that you're always writing to a file (so you can tap Cmd-S often) rather than into a buffer.

Although I think Textmate is great, and definitely worth the money, I'm also pretty sure that Apple's XCode will do auto-indenting. Not sure how unwieldy it would be to use as a simple text editor, though, since it's fairly well-integrated with their other tools, I think. It's free and already on your system if you have Developer Tools installed (which you should, if you're anything except a very casual user).
posted by Kadin2048 at 7:20 PM on October 27, 2007

Response by poster: In Textpad there was a way to make it so whenever you opened a new file, it was automatically a .php. I guess I will just save it as soon as I open it.

This switching thing is hard. I may have to become bi-OS :)
posted by jesirose at 7:57 PM on October 27, 2007

I feel your pain... Text Pad has been one of the hardest to give up in my recent and exceedingly painful switch to Mac. One solution that's not been mentioned here. Get yourself a copy of Parallels and run TextPad directly on your Mac desktop. It's what I'm doing at present. :)
posted by Dio at 4:15 PM on November 7, 2007

« Older Are weevils poisonous, or just gross?   |   Dancehall Reggae Song ID filter Newer »
This thread is closed to new comments.