forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-slime.el
50 lines (36 loc) · 1.55 KB
/
init-slime.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
49
50
(require-package 'slime)
;; package.el compiles the contrib subdir, but the compilation order
;; causes problems, so we remove the .elc files there. See
;; http://lists.common-lisp.net/pipermail/slime-devel/2012-February/018470.html
(mapc #'delete-file
(file-expand-wildcards (concat user-emacs-directory "elpa/slime-2*/contrib/*.elc")))
(require-package 'ac-slime)
(require-package 'hippie-expand-slime)
;;; Lisp buffers
(defun sanityinc/slime-setup ()
"Mode setup function for slime lisp buffers."
(set-up-slime-hippie-expand)
(set-up-slime-ac t))
(after-load 'slime
(setq slime-protocol-version 'ignore)
(setq slime-net-coding-system 'utf-8-unix)
(slime-setup '(slime-repl slime-fuzzy))
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
(add-hook 'slime-mode-hook 'sanityinc/slime-setup))
;;; REPL
(defun sanityinc/slime-repl-setup ()
"Mode setup function for slime REPL."
(sanityinc/lisp-setup)
(set-up-slime-hippie-expand)
(set-up-slime-ac t)
(setq show-trailing-whitespace nil))
(after-load 'slime-repl
;; Stop SLIME's REPL from grabbing DEL, which is annoying when backspacing over a '('
(define-key slime-repl-mode-map (read-kbd-macro paredit-backward-delete-key) nil)
;; Bind TAB to `indent-for-tab-command', as in regular Slime buffers.
(define-key slime-repl-mode-map (kbd "TAB") 'indent-for-tab-command)
(add-hook 'slime-repl-mode-hook 'sanityinc/slime-repl-setup))
(after-load 'auto-complete
(add-to-list 'ac-modes 'slime-repl-mode))
(provide 'init-slime)