V2 Emacs config now kept as it's own repository.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

2 years ago
;;; lisp-mode-settings.el --- Settings for lisp modes.
;; Slime - requires SBCL to be installed in /usr/local/bin/ (default for the install.sh
;; script)
(use-package paredit
:ensure t
:hook ((emacs-lisp-mode . enable-paredit-mode)
(eval-expression-minibuffer-setup . enable-paredit-mode)
(ielm-mode . enable-paredit-mode)
(lisp-mode . enable-paredit-mode)
(lisp-interaction-mode . enable-paredit-mode)
(scheme-mode . enable-paredit-mode)))
(use-package rainbow-delimiters
:ensure t
:hook ((clojure-mode . rainbow-delimiters-mode)
(lisp-mode . rainbow-delimiters-mode)
(scheme-mode . rainbow-delimiters-mode)
(emacs-lisp-mode . rainbow-delimiters-mode)))
;; Force code to always be indented correctly.
(use-package aggressive-indent
:ensure t
:hook ((emacs-lisp-mode . aggressive-indent-mode)
(lisp-mode . aggressive-indent-mode)
(scheme-mode . aggressive-indent-mode)
(clojure-mode . aggressive-indent-mode)))
2 years ago
(use-package slime
:ensure t
:config
(global-unset-key (kbd "<f1>"))
(global-unset-key (kbd "<f2>"))
(define-key lisp-mode-map (kbd "<f1>") 'slime-eval-buffer)
(define-key lisp-mode-map (kbd "<f2>") 'slime-eval-defun))
(setq inferior-lisp-program "sbcl")
(setq slime-contribs '(slime-fancy))
;; Enable paredit for lisp
(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
;; Autoload the indent function
(autoload 'common-lisp-indent-function "cl-indent" "Common Lisp indent.")
(defun override-slime-repl-bindings-with-paredit ()
(define-key slime-repl-mode-map
(read-kbd-macro paredit-backward-delete-key) nil))
(add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-with-paredit)
;;---------------------------------------------------------
;; SLIME Quicklisp Integration.
;;---------------------------------------------------------
(when (file-exists-p "~/quicklisp/slime-helper.el")
(load (expand-file-name "~/quicklisp/slime-helper.el"))
(setq inferior-lisp-program "sbcl"))