2020-08-31 15:19:48 +02:00
|
|
|
;;; wpc-lisp.el --- Generic LISP preferences -*- lexical-binding: t -*-
|
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
;; Author: William Carroll <wpcarro@gmail.com>
|
2020-08-31 15:19:48 +02:00
|
|
|
;; Version: 0.0.1
|
|
|
|
;; Package-Requires: ((emacs "24"))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
2020-08-31 15:19:48 +02:00
|
|
|
;;; Commentary:
|
2019-10-09 13:13:56 +02:00
|
|
|
;; parent (up)
|
|
|
|
;; child (down)
|
|
|
|
;; prev-sibling (left)
|
|
|
|
;; next-sibling (right)
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
2020-01-22 22:11:24 +01:00
|
|
|
;; TODO: Consider having a separate module for each LISP dialect.
|
|
|
|
|
2020-01-20 13:11:46 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Dependencies
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
(require 'general)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Configuration
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2020-08-31 15:19:48 +02:00
|
|
|
(defconst wpc-lisp--hooks
|
2019-10-09 13:13:56 +02:00
|
|
|
'(lisp-mode-hook
|
|
|
|
emacs-lisp-mode-hook
|
|
|
|
clojure-mode-hook
|
|
|
|
clojurescript-mode-hook
|
|
|
|
racket-mode-hook)
|
|
|
|
"List of LISP modes.")
|
|
|
|
|
2020-01-22 22:09:44 +01:00
|
|
|
(use-package sly
|
|
|
|
:config
|
|
|
|
(setq inferior-lisp-program "sbcl")
|
|
|
|
(general-define-key
|
|
|
|
:keymaps 'sly-mode-map
|
|
|
|
:states '(normal)
|
|
|
|
:prefix "<SPC>"
|
|
|
|
"x" #'sly-eval-defun
|
|
|
|
"X" #'sly-eval-buffer
|
|
|
|
"d" #'sly-describe-symbol))
|
|
|
|
|
2019-12-22 22:28:49 +01:00
|
|
|
(use-package rainbow-delimiters
|
|
|
|
:config
|
2020-08-31 15:19:48 +02:00
|
|
|
(general-add-hook wpc-lisp--hooks #'rainbow-delimiters-mode))
|
2019-12-22 22:28:49 +01:00
|
|
|
|
2019-10-09 13:13:56 +02:00
|
|
|
(use-package racket-mode
|
|
|
|
:config
|
|
|
|
(general-define-key
|
|
|
|
:keymaps 'racket-mode-map
|
|
|
|
:states 'normal
|
|
|
|
:prefix "<SPC>"
|
2020-01-22 22:08:39 +01:00
|
|
|
"x" #'racket-send-definition
|
|
|
|
"X" #'racket-run
|
2019-10-09 13:13:56 +02:00
|
|
|
"d" #'racket-describe)
|
|
|
|
(setq racket-program "~/.nix-profile/bin/racket"))
|
|
|
|
|
|
|
|
(use-package lispyville
|
|
|
|
:init
|
2020-08-31 15:19:48 +02:00
|
|
|
(defconst wpc-lisp--lispyville-key-themes
|
2019-10-09 13:13:56 +02:00
|
|
|
'(c-w
|
|
|
|
operators
|
|
|
|
text-objects
|
|
|
|
prettify
|
|
|
|
commentary
|
|
|
|
slurp/barf-cp
|
|
|
|
wrap
|
|
|
|
additional
|
|
|
|
additional-insert
|
|
|
|
additional-wrap
|
|
|
|
escape)
|
|
|
|
"All available key-themes in Lispyville.")
|
|
|
|
:config
|
2020-08-31 15:19:48 +02:00
|
|
|
(general-add-hook wpc-lisp--hooks #'lispyville-mode)
|
|
|
|
(lispyville-set-key-theme wpc-lisp--lispyville-key-themes)
|
2019-10-09 13:13:56 +02:00
|
|
|
(progn
|
|
|
|
(general-define-key
|
|
|
|
:keymaps 'lispyville-mode-map
|
|
|
|
:states 'motion
|
|
|
|
;; first unbind
|
|
|
|
"M-h" nil
|
|
|
|
"M-l" nil)
|
|
|
|
(general-define-key
|
|
|
|
:keymaps 'lispyville-mode-map
|
|
|
|
:states 'normal
|
|
|
|
;; first unbind
|
|
|
|
"M-j" nil
|
|
|
|
"M-k" nil
|
|
|
|
;; second rebind
|
2020-01-06 11:08:00 +01:00
|
|
|
"C-s-h" #'lispyville-drag-backward
|
|
|
|
"C-s-l" #'lispyville-drag-forward
|
|
|
|
"C-s-e" #'lispyville-end-of-defun
|
|
|
|
"C-s-a" #'lispyville-beginning-of-defun)))
|
2019-10-09 13:13:56 +02:00
|
|
|
|
|
|
|
;; Elisp
|
|
|
|
(use-package elisp-slime-nav
|
|
|
|
:config
|
|
|
|
(general-add-hook 'emacs-lisp-mode #'ielm-mode))
|
|
|
|
|
|
|
|
(general-define-key
|
|
|
|
:keymaps 'emacs-lisp-mode-map
|
|
|
|
:prefix "<SPC>"
|
|
|
|
:states 'normal
|
2020-01-20 13:11:46 +01:00
|
|
|
"x" #'eval-defun
|
|
|
|
"X" #'eval-buffer
|
2019-10-09 13:13:56 +02:00
|
|
|
"d" (lambda ()
|
|
|
|
(interactive)
|
|
|
|
(with-current-buffer (current-buffer)
|
|
|
|
(helpful-function (symbol-at-point)))))
|
|
|
|
|
|
|
|
(provide 'wpc-lisp)
|
|
|
|
;;; wpc-lisp.el ends here
|