Skip to content

Instantly share code, notes, and snippets.

@devn
Created April 13, 2013 20:28
Show Gist options
  • Save devn/5379950 to your computer and use it in GitHub Desktop.
Save devn/5379950 to your computer and use it in GitHub Desktop.
Simple Clojure Config
;; Make sure we can execute things in our ~/bin DIR
;; This may not be necessary if you're running emacs from the terminal.
(add-to-list 'exec-path (expand-file-name "~/bin"))
(setenv "PATH" (concat (expand-file-name "~/bin") ":" (getenv "PATH")))
;; Packages
(require 'package)
(require 'hippie-exp)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar my-packages
'(ac-slime
align-cljlet
auto-complete
auto-indent-mode
clojure-mode
clojure-test-mode
clojurescript-mode
clj-refactor
kibit-mode
dired-details
find-file-in-project
hl-sexp
markdown-mode
monokai-theme
cyberpunk-theme
zen-and-art-theme
nrepl
org
paredit
ruby-mode))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
;; pry-emacs
(setq ruby-paths
(mapcar
(lambda (p) (expand-file-name p))
'("~/.rvm/gems/ruby-1.9.3-p392/bin"
"~/.rvm/gems/ruby-1.9.3-p392@global/bin"
"~/.rvm/rubies/ruby-1.9.3-p392/bin"
"~/.rvm/bin")))
(dolist (ruby-path ruby-paths)
(add-to-list 'exec-path ruby-path))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/vendor/emacs-pry"))
(require 'pry)
(global-set-key [S-f9] 'pry-intercept)
(global-set-key [f9] 'pry-intercept-rerun)
;;
;; clojure-mode
;;
(autoload 'clojure-mode "clojure-mode" nil t)
(autoload 'align-cljlet "align-cljlet" nil t)
;;
;; nrepl
;;
(add-hook 'nrepl-mode-hook
'subword-mode
'paredit-mode)
(add-hook 'nrepl-interaction-mode-hook
'nrepl-turn-on-eldoc-mode)
(add-hook 'clojure-mode-hook
'eldoc-mode)
(setq nrepl-popup-stacktraces nil)
;;
;; Bindings
;;
(global-set-key (kbd "RET") 'newline-and-indent)
(global-set-key (kbd "C-x M-c") 'nrepl-jack-in)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment