Skip to content

Instantly share code, notes, and snippets.

@tobias
Created December 12, 2013 15:19
Show Gist options
  • Save tobias/7929634 to your computer and use it in GitHub Desktop.
Save tobias/7929634 to your computer and use it in GitHub Desktop.
(add-hook 'clojure-mode-hook 'tc/run-common-coding-hooks)
(add-hook 'clojure-mode-hook 'tc/run-lisp-coding-hooks)
(add-to-list 'auto-mode-alist '("\\.dtm$" . clojure-mode))
(add-to-list 'auto-mode-alist '("\\.edn$" . clojure-mode))
(add-to-list 'auto-mode-alist '("\\.cljs$" . clojure-mode))
(setq clojure-defun-style-default-indent t)
(setq nrepl-popup-stacktraces nil)
(setq nrepl-popup-stacktraces-in-repl t)
(when (not tc/presentation-mode-p)
(add-to-list 'pretty-symbol-patterns
'(?λ lambda "(\\(fn\\)\\>" (clojure-mode nrepl-repl-mode) 1))
(add-to-list 'pretty-symbol-patterns
'(?λ lambda "\\(#\\)(" (clojure-mode nrepl-repl-mode) 1)))
(require 'nrepl)
(add-hook 'nrepl-repl-mode-hook 'tc/run-lisp-coding-hooks)
(defun run-nrepl-command (buf command)
(with-current-buffer buf
(goto-char (point-max))
(insert-char ?\n)
(insert command)
(nrepl-return)))
(defun send-expr-to-repl ()
(interactive)
(run-nrepl-command (nrepl-current-repl-buffer)
(nrepl-expression-at-point)))
(defun send-previous-expr-to-repl ()
(interactive)
(run-nrepl-command (nrepl-current-repl-buffer)
(nrepl-last-expression)))
(define-key nrepl-interaction-mode-map (kbd "C-c C-c") 'send-expr-to-repl)
(define-key nrepl-interaction-mode-map (kbd "C-c C-e") 'send-previous-expr-to-repl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment