TextMate : My Choice

As a Mac user I prefer to use the tools optimized for the OS, therefore I migrated from Emacs to TextMate. I must say I am very amazed with the power of TextMate.

( Check out the features on this blog )

Let’s now improve our developper experience by optimizing TextMate for OCaml production.

1) Compile-Build-Run

As a lot of IDE’s, the OCaml bundle as a Run option.
(If you don’t have the bundle installed chec this guide)

In TextMate’s case it uses the commands ocamlc and ocamlfind.

ocamlc comes with the ocaml distribution, however, the PATH is, usually, not correct in the default bin PAHTS of TextMate.

To add ocamlc PATH to TextMate, go to Preferences -> Advanced -> Shell Variables, and edit the text associated with PATH. Should be something like:


To add the correct PATH we must first find where it was installed. The default is : /usr/local/bin

But to be sure, open a Terminal window and insert:
sudo find / -name ocamlc

The path showed is the correct one.

To insert the path just add “:” (ex -> /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin )

Now if you try to run the file it will compile but will fail to link possible used libraries to the missing ocamlfind command.

ocamlfind command is not pre-installed with the distribution, therefore you must download it and install it yourself.

You can download it from -> this page
Follow the instruction in the INSTAL file.

Now try again to Run the code from within TextMate.

It should work! It works? Amazing

2) Perfect Theme

I highly recommend this theme:

Tomorow Night

Download it from the repository and simply double click to add it to TextMate.

Altough it is amazing by default, a few costumizations really improve it, in my opinion.
For example, add highlightin for support and punctuation it really helps making ocaml code clearer

3) Tutorials

Here is a good turorial:


Here is a good book:

TextMate How-To


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: