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:

[[ -f "${TM_SUPPORT_PATH}/lib/" ]] && . "${TM_SUPPORT_PATH}/lib/"
if [ -e “${TM_FILEPATH}” ]; then
“/usr/local/bin/lein” “exec” “${TM_FILEPATH}”
puts “File not found or not saved. Please save first”