forked from magnars/.emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-clojure-mode.el
48 lines (32 loc) · 1.39 KB
/
setup-clojure-mode.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
(require 'clojure-mode)
(defadvice clojure-test-run-tests (before save-first activate)
(save-buffer))
(defadvice nrepl-load-current-buffer (before save-first activate)
(save-buffer))
(require 'clj-refactor)
(cljr-add-keybindings-with-modifier "C-s-")
(define-key clj-refactor-map (kbd "C-x C-r") 'cljr-rename-file)
(add-hook 'clojure-mode-hook
(lambda ()
(clj-refactor-mode 1)
(smartparens-mode 1)))
(define-key clojure-mode-map (kbd "s-j") 'clj-jump-to-other-file)
(require 'cider)
(define-key cider-repl-mode-map (kbd "<home>") nil)
(define-key cider-repl-mode-map (kbd "C-,") 'complete-symbol)
(define-key cider-mode-map (kbd "C-,") 'complete-symbol)
;; Indent and highlight more commands
(put-clojure-indent 'match 'defun)
;; Hide nrepl buffers when switching buffers (switch to by prefixing with space)
(setq nrepl-hide-special-buffers t)
;; Enable error buffer popping also in the REPL:
(setq cider-repl-popup-stacktraces t)
;; Specify history file
(setq cider-history-file "~/.emacs.d/nrepl-history")
;; auto-select the error buffer when it's displayed
(setq cider-auto-select-error-buffer t)
;; Prevent the auto-display of the REPL buffer in a separate window after connection is established
(setq cider-repl-pop-to-buffer-on-connect nil)
;; Enable eldoc in Clojure buffers
(add-hook 'cider-mode-hook 'cider-turn-on-eldoc-mode)
(provide 'setup-clojure-mode)