Running Clojure via TextMate 2

TextMate 2 exists only on Mac OS X, therefore I’m assuming usage of Homebrew

1. Homebrew installation of Leiningen

$ brew install leiningen

2. Installation of Leiningen lein-exec plugin via adding to ~/.lein/profiles.clj:

{:user {:plugins [[lein-exec "0.3.5"]]}}

3. Manual installation of the (old) TextMate Clojure Bundle. TextMate 2 Bundles are living now under this directory and not as described in the Github repo:

cd ~/Library/Application\ Support/TextMate/Managed/Bundles/

4. Within TextMate 2 > Edit Bundles > Clojure > Menu Actions > Rename and edit the ‘Cake Start’ to ‘Run’ with the following scriptlet:

#!/bin/bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
if [ -e “${TM_FILEPATH}” ]; then
“/usr/local/bin/lein” “exec” “${TM_FILEPATH}”
exit_show_tool_tip
else
puts “File not found or not saved. Please save first”
fi
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s