OxyCo

November 24, 2006

Inconsolata fonts for OSX

Filed under: OSX, TextMate — atma @ 4:47 pm

After reading cosmix’s post about a font called Inconsolata I managed to install the font under MACOSX very easily, through fontbook - MacOSX application for managing fonts - and for the first time I realised the difference between different fonts. My TextMate looks more beautiful than ever! This font is amazing. Although it does not support Greek I think I’ll made it my default font under TextMate.
I am Greek as you probably realised/know so not having Greek support is not acceptable. However Raph Levien managed to find out the post and promised some support if the interest is strong enough for Greek chars. Apparently there are some issues under Windows and I didn’t tried out under GNU/Linux and/or *BSD. I’ll try it out under FreeBSD when I have to time to install it on my x86 Desktop. Try the otf file now!

November 5, 2006

Creating Bundles with TextMate

Filed under: TextMate — atma @ 2:13 pm

As a starter I write small programs that I’d like to see executed at once. The book has two suggestions for those who are using MacOSX:

a) Use xCode ( which is a software that I’ll need to learn somewhere in the remote future )

b) Use Gcc through command line. ( which is what I had in mind since day 1 actually )

However I felt uncomfortable having a terminal open along with TextMate just to compile programs. So I start looking for a shortcut that will do the job for me, nothing complicated: Just compile the current .m file, run it and show eventual errors otherwise the output.
I searched the manual and I found the apple-command+B shortcut which tries to compile the .m file with xCode unsuccessfully. The problem is that xCode looks for xCode-projects inside the working directory, so it does not recognize on the fly the specific file.
After that I looked at macromates for other info, because I was sure that something similar already exists. Nothing though, the Build command was bounded to xCode for .m files.
At this point I joined the IRC textmate support channel on Freenode. A found a Greek guy under the nickname cskiadas which helped me create my first bundle!
It was easier than expected! TextMate surprised me in a very positive way already! So what I did was:

Bundles -> Bundle Editor -> Edit Commands | New Commands

Following cskiadas advice I did not put the new bundle under Objective-C Bundles, I put it under my own Bundle category created by TextMate. The first thing we need to do is satisfy the Scope Selector which in my case was source.objc. Then following the GUI was easy to create a key shortcut I decide for apple-command+B which is the default shortcut for Build. I decide to watch the output in tooltip mode which is much more convenient and fancy than Document mode, which open’s another document and paste’s the output. Mr. cskiadas told me that tooltip may have issues with large text. Kept that in mind, but after all.. changing that option takes 3 seconds. Now the hard part was to put together the code that compiles & run’s the file. Mr. cskiadas helped with a short example and key feature to go peaceful with .m files.. here is the code:

	# just to remind you of some useful environment variables
	# see Help / Environment Variables for the full list
	#echo File: "$TM_FILEPATH"
	#echo Word: "$TM_CURRENT_WORD"
	#echo Selection: "$TM_SELECTED_TEXT"

	#!/usr/bin/sh  - atma 05/11/2006
	BASE=${TM_FILEPATH%.m}
	gcc "$TM_FILEPATH" -o "$BASE" -l objc

	# Simple bash check out and compile

	if [[ -e $BASE ]]
	  then
	     echo “Executing $BASE”
	     echo “”
	     exec $BASE
	else
	     echo “”
	     echo “File does not exist”
	fi

The BASE=${TM_FILEPATH%.m} variable saved me from having hard time. The %m option means “without the .m extension”. The $TM_FILEPATH variable stands for full path filename as you can imagine. The rest is simple shell code which I put together with a little goggling ( I didn’t remember the -e variable for bash’s test ) just to make it more elegant.

Now when I type apple-command+B I get the compile & run results on the fly, inside a tooltip!

tooltip

November 3, 2006

TextMate blogging & the Objective C book intro

Filed under: Objective C, TextMate — atma @ 3:44 pm

Following the this video I did not managed to post through TextMate the famous MacOSX all-in-one editor. Although the blog functionality seems quite elegant doesn’t work as it should.
First all when fetching post’s through wordpress.com it fetches my Dashboard articles and not my previous posts. I don’t know why, maybe WordPress API is not working as it should? I’m quite positive that Allan’s blog should be a WordPress blog although from the video I didn’t understand if it’s WordPress or webpress, the spelling was not clear enough plus the fact I don’t speak native English, so I can’t be sure. He uses Markdown instead of HTML though. When I post I get error cannot post to this blog or category - (401). So if anyone reading this (Hello?) has managed to use TextMate with wordpress.com please let me know. Anyway..
I purchased from Amazon the following book: Programming in Objective-C by Stephen Kochan.
The first impression is good. The book seems to be what I needed in first place and has some positive feedback at Amazon’s website.

Jeez, writing in simple html for blog post’s in TextMate is much more easy then using other editors! Actually most of my posts were written in TextEdit which I like very much for it’s power and simplicity, but it’s not an HTML editor to make an acceptable comparison!

I noticed that most of the mac programs like the one’s already mentioned, QuickSilver, VoodooPad, etc. are made in a very smart, elegant, simple yet powerful way. It’s not just the operating system, it’s the entire community that has a genius mindset :-)
uhh!!
I need to get some sleep and read a bit about instances and methods!!!

Cheerz!

EDIT: Update! I’m editing through TextMate!

My mistake was putting the this line:

oxyCo http://atma@wordpress.com/xmlrpc.php

instead of this:

oxyCo http://atma@atma.wordpress.com/xmlrpc.php

Now seems to work perfectly! :-)

EDIT2: I just purchased TextMate. Hope it’s worth the 39$!!

Blog at WordPress.com.