Posts Tagged ‘TextMate’

I updated my gcc formatting php script.

Tuesday, March 24th, 2009

A while ago I wrote a script that formats gcc output to link errors back into TM. I updated that script with support for warnings and added some cool looking construction theme colors for the errors and warnings. Have a look see.

Formatting gcc and g++ output for TextMate.

First Software Purchased Evar.

Monday, February 4th, 2008

The first piece of [non-game] software I ever purchased was TextMate, just now. I buckled down and bought it. It is flippin sweet. I hope my move to linux finds me an equivalent editor. DORKSAUCE. Ah, I also bought 4GB of RAM for my MacBook for $80 at newegg. That’s almost 10x less than buying 2GB from Apple. They’re not “fully buffered EEC” but 2x2GB @ $36 each? Bomb! > 2x1GB @ $150 each, that’s for sure. I’ll let you know how it goes after installation.

*update*
Macbook Pros (at least my model) only support a max of 3gb of RAM. So I’m full up and have 2gb left over. I’m giving it to my friend Matthew. My mbp’s been running great with the new memory, so it’s all good.

Auto Comment Block In TextMate

Monday, January 21st, 2008

If you haven’t heard of TextMate go check it out it’s sweet. It allows a helluva lot of automation and is damn near the only thing you need for development of any language [minus compilers]. I’m about ready to throw away my Flash CS3 IDE I got for free from my day job and shell out the 39 pounds to buy it [those of you who know me personally know I don't ever buy software].

So, here’s a little command I wrote in the form of a bash script [I think all textmate commands are bash scripts or cocoadialog thangs]. The script takes selected input and pads it with “/* */” if it isn’t already, effectively commenting the text or it strips the comment block. I don’t write shell scripts often, so I like it when I get one that’s really useful.

#!/bin/bash

#-------------------------------------------------------------------------
# Make comment / Undo comment
# by Schell Scivally
# @ efnx.com
#-------------------------------------------------------------------------

opening=`echo "$TM_SELECTED_TEXT" | awk 'BEGIN {nlines=0} /\/\*/ {nlines++} END {print nlines}'`
if [[ "$opening" == 0 ]];
    then
        echo -n "/*$TM_SELECTED_TEXT*/"
    else
        output=`echo "$TM_SELECTED_TEXT" | sed 's/\*\///g' | sed 's/\/\*//g'`
        echo -n "$output"
fi

Follow me on GitHub
Follow me on Google+
Follow me on Twitter