2015-07-09 19:55:14 +00:00
|
|
|
;;; packages.el --- Common Lisp Layer packages File for Spacemacs
|
2015-03-07 21:58:35 +00:00
|
|
|
;;
|
2020-09-16 21:34:40 +00:00
|
|
|
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
|
2015-03-07 21:58:35 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-07-09 19:55:14 +00:00
|
|
|
(setq common-lisp-packages
|
2018-11-20 19:55:37 +00:00
|
|
|
'(
|
|
|
|
auto-highlight-symbol
|
2017-07-03 07:52:54 +00:00
|
|
|
(common-lisp-snippets :requires yasnippet)
|
2017-04-23 17:22:20 +00:00
|
|
|
evil
|
2018-01-04 06:34:23 +00:00
|
|
|
evil-cleverparens
|
2016-04-05 04:08:34 +00:00
|
|
|
ggtags
|
2018-06-01 03:43:02 +00:00
|
|
|
counsel-gtags
|
2016-05-27 00:09:54 +00:00
|
|
|
helm
|
2016-04-05 04:08:34 +00:00
|
|
|
helm-gtags
|
2017-05-29 09:35:22 +00:00
|
|
|
parinfer
|
2020-01-13 08:24:13 +00:00
|
|
|
rainbow-identifiers
|
2016-09-04 15:46:13 +00:00
|
|
|
slime
|
2021-03-16 18:54:18 +00:00
|
|
|
(slime-company :requires company)))
|
|
|
|
|
2016-01-21 20:56:35 +00:00
|
|
|
|
|
|
|
(defun common-lisp/post-init-auto-highlight-symbol ()
|
|
|
|
(with-eval-after-load 'auto-highlight-symbol
|
|
|
|
(add-to-list 'ahs-plugin-bod-modes 'lisp-mode)))
|
2015-03-07 21:58:35 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun common-lisp/init-common-lisp-snippets ())
|
2016-05-27 00:09:54 +00:00
|
|
|
|
2017-04-23 17:22:20 +00:00
|
|
|
(defun common-lisp/post-init-evil ()
|
|
|
|
(defadvice slime-last-expression (around evil activate)
|
|
|
|
"In normal-state or motion-state, last sexp ends at point."
|
|
|
|
(if (and (not evil-move-beyond-eol)
|
|
|
|
(or (evil-normal-state-p) (evil-motion-state-p)))
|
|
|
|
(save-excursion
|
|
|
|
(unless (or (eobp) (eolp)) (forward-char))
|
|
|
|
ad-do-it)
|
|
|
|
ad-do-it)))
|
|
|
|
|
2018-01-04 06:34:23 +00:00
|
|
|
(defun common-lisp/pre-init-evil-cleverparens ()
|
|
|
|
(spacemacs|use-package-add-hook evil-cleverparens
|
|
|
|
:pre-init
|
|
|
|
(progn
|
|
|
|
(add-to-list 'evil-lisp-safe-structural-editing-modes 'common-lisp-mode)
|
|
|
|
(add-to-list 'evil-lisp-safe-structural-editing-modes 'lisp-mode))))
|
|
|
|
|
2016-05-27 00:09:54 +00:00
|
|
|
(defun common-lisp/post-init-helm ()
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'lisp-mode
|
|
|
|
"sI" 'spacemacs/helm-slime))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun common-lisp/post-init-ggtags ()
|
2016-08-15 19:24:44 +00:00
|
|
|
(add-hook 'common-lisp-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
2017-08-26 21:18:09 +00:00
|
|
|
(defun common-lisp/post-init-counsel-gtags ()
|
|
|
|
(spacemacs/counsel-gtags-define-keys-for-mode 'common-lisp-mode))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun common-lisp/post-init-helm-gtags ()
|
|
|
|
(spacemacs/helm-gtags-define-keys-for-mode 'common-lisp-mode))
|
|
|
|
|
2017-05-29 09:35:22 +00:00
|
|
|
(defun common-lisp/post-init-parinfer ()
|
|
|
|
(add-hook 'lisp-mode-hook 'parinfer-mode))
|
|
|
|
|
2020-01-13 08:24:13 +00:00
|
|
|
(defun common-lisp/post-init-rainbow-identifiers ()
|
|
|
|
(add-hook 'lisp-mode-hook #'colors//rainbow-identifiers-ignore-keywords))
|
|
|
|
|
2018-01-11 04:57:18 +00:00
|
|
|
(defun common-lisp/pre-init-slime-company ()
|
2017-04-23 17:09:46 +00:00
|
|
|
(spacemacs|use-package-add-hook slime
|
2017-05-01 07:55:59 +00:00
|
|
|
:pre-config
|
2017-04-23 17:09:46 +00:00
|
|
|
(progn
|
|
|
|
(setq slime-company-completion 'fuzzy)
|
|
|
|
(add-to-list 'slime-contribs 'slime-company))))
|
2018-01-11 04:57:18 +00:00
|
|
|
(defun common-lisp/init-slime-company ())
|
2016-09-04 15:46:13 +00:00
|
|
|
|
2015-07-09 19:55:14 +00:00
|
|
|
(defun common-lisp/init-slime ()
|
2015-03-09 03:43:40 +00:00
|
|
|
(use-package slime
|
|
|
|
:commands slime-mode
|
|
|
|
:init
|
|
|
|
(progn
|
2016-01-26 16:31:15 +00:00
|
|
|
(spacemacs/register-repl 'slime 'slime)
|
2017-04-01 16:44:31 +00:00
|
|
|
(setq slime-contribs '(slime-asdf
|
|
|
|
slime-fancy
|
2015-03-31 05:42:13 +00:00
|
|
|
slime-indentation
|
|
|
|
slime-sbcl-exts
|
|
|
|
slime-scratch)
|
2015-03-09 03:43:40 +00:00
|
|
|
inferior-lisp-program "sbcl")
|
2015-03-31 05:42:13 +00:00
|
|
|
;; enable fuzzy matching in code buffer and SLIME REPL
|
|
|
|
(setq slime-complete-symbol*-fancy t)
|
|
|
|
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
|
2021-03-16 18:54:18 +00:00
|
|
|
(add-hook 'slime-repl-mode-hook #'spacemacs//disable-smartparens)
|
2015-08-23 01:47:30 +00:00
|
|
|
(spacemacs/add-to-hooks 'slime-mode '(lisp-mode-hook)))
|
2015-03-09 03:43:40 +00:00
|
|
|
:config
|
2015-06-22 03:46:36 +00:00
|
|
|
(progn
|
|
|
|
(slime-setup)
|
2015-07-11 01:32:10 +00:00
|
|
|
;; TODO: Add bindings for the SLIME debugger?
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'lisp-mode
|
2016-01-26 16:31:15 +00:00
|
|
|
"'" 'slime
|
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"cc" 'slime-compile-file
|
|
|
|
"cC" 'slime-compile-and-load-file
|
|
|
|
"cl" 'slime-load-file
|
|
|
|
"cf" 'slime-compile-defun
|
|
|
|
"cr" 'slime-compile-region
|
|
|
|
"cn" 'slime-remove-notes
|
2015-03-17 20:27:11 +00:00
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"eb" 'slime-eval-buffer
|
|
|
|
"ef" 'slime-eval-defun
|
|
|
|
"eF" 'slime-undefine-function
|
2016-05-06 11:29:39 +00:00
|
|
|
"ee" 'slime-eval-last-expression
|
2017-04-23 17:22:20 +00:00
|
|
|
"el" 'spacemacs/slime-eval-sexp-end-of-line
|
2015-11-18 00:38:05 +00:00
|
|
|
"er" 'slime-eval-region
|
2015-03-17 20:27:11 +00:00
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"gb" 'slime-pop-find-definition-stack
|
|
|
|
"gn" 'slime-next-note
|
|
|
|
"gN" 'slime-previous-note
|
2015-03-17 20:27:11 +00:00
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"ha" 'slime-apropos
|
|
|
|
"hA" 'slime-apropos-all
|
|
|
|
"hd" 'slime-disassemble-symbol
|
|
|
|
"hh" 'slime-describe-symbol
|
|
|
|
"hH" 'slime-hyperspec-lookup
|
2017-01-13 03:33:09 +00:00
|
|
|
"hi" 'slime-inspect-definition
|
2015-11-18 00:38:05 +00:00
|
|
|
"hp" 'slime-apropos-package
|
|
|
|
"ht" 'slime-toggle-trace-fdefinition
|
|
|
|
"hT" 'slime-untrace-all
|
|
|
|
"h<" 'slime-who-calls
|
|
|
|
"h>" 'slime-calls-who
|
2015-07-11 01:32:10 +00:00
|
|
|
;; TODO: Add key bindings for who binds/sets globals?
|
2015-11-18 00:38:05 +00:00
|
|
|
"hr" 'slime-who-references
|
|
|
|
"hm" 'slime-who-macroexpands
|
|
|
|
"hs" 'slime-who-specializes
|
2015-03-17 20:27:11 +00:00
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"ma" 'slime-macroexpand-all
|
|
|
|
"mo" 'slime-macroexpand-1
|
2015-03-17 20:27:11 +00:00
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
"se" 'slime-eval-last-expression-in-repl
|
|
|
|
"si" 'slime
|
|
|
|
"sq" 'slime-quit-lisp
|
2015-07-11 01:32:10 +00:00
|
|
|
|
2019-04-07 17:39:56 +00:00
|
|
|
"tf" 'slime-toggle-fancy-trace
|
|
|
|
|
|
|
|
;; Add key bindings for custom eval functions
|
|
|
|
"ec" 'spacemacs/cl-eval-current-form-sp
|
|
|
|
"eC" 'spacemacs/cl-eval-current-form
|
2021-03-16 18:54:18 +00:00
|
|
|
"es" 'spacemacs/cl-eval-current-symbol-sp)
|
|
|
|
|
2016-05-16 00:49:45 +00:00
|
|
|
;; prefix names for which-key
|
|
|
|
(mapc (lambda (x)
|
|
|
|
(spacemacs/declare-prefix-for-mode 'lisp-mode (car x) (cdr x)))
|
|
|
|
'(("mh" . "help")
|
|
|
|
("me" . "eval")
|
|
|
|
("ms" . "repl")
|
|
|
|
("mc" . "compile")
|
|
|
|
("mg" . "nav")
|
|
|
|
("mm" . "macro")
|
|
|
|
("mt" . "toggle"))))))
|