aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/config.org
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2022-09-14 00:29:03 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2022-09-14 00:47:16 +0100
commit6bb587d877268210ae0bfec79e32996292ac5b4f (patch)
tree581de791d00394a31a3a16b7fd57a8e2cc3e57ba /Emacs/.config/emacs/config.org
parent0f00c351aad2c962146c7841901bf23ea6dfa6d9 (diff)
downloaddotfiles-6bb587d877268210ae0bfec79e32996292ac5b4f.tar.gz
dotfiles-6bb587d877268210ae0bfec79e32996292ac5b4f.tar.bz2
dotfiles-6bb587d877268210ae0bfec79e32996292ac5b4f.zip
(Emacs)+common lisp configuration
Using sly, make a LISP IDE in Emacs. REPL with high level integration, first class syntax highlighting and error reporting and an environment literally built out of it.
Diffstat (limited to 'Emacs/.config/emacs/config.org')
-rw-r--r--Emacs/.config/emacs/config.org59
1 files changed, 56 insertions, 3 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index 23dd428..c1ed907 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -2801,14 +2801,67 @@ Kinda expressive, interesting.
:init
(setq typescript-indent-level 2))
#+end_src
-** Emacs lisp
+** Common Lisp
+Common Lisp is a dialect of Lisp, the most /common/ one around. Emacs
+comes with builtin Lisp support of course, but a REPL would be nice.
+
+Enter /SLY/. Sly is a fork of /SLIME/ and is *mandatory* for lisp
+development on Emacs.
+
+#+begin_src emacs-lisp
+(use-package sly
+ :straight t
+ :init
+ (setq inferior-lisp-program "sbcl")
+ :display
+ ("\\*sly-db"
+ (display-buffer-at-bottom)
+ (window-height . 0.5))
+ ("\\*sly-"
+ (display-buffer-at-bottom)
+ (window-height . 0.25))
+ :config
+ (evil-set-initial-state 'sly-db-mode 'emacs)
+ (+dx/create-toggle-function
+ +shell/toggle-sly
+ "*sly-mrepl for sbcl*"
+ sly-mrepl)
+ :general
+ ; general binds
+ (nmap
+ :keymaps '(lisp-mode-map sly-mrepl-mode-map)
+ "gr" #'sly-eval-buffer
+ "gd" #'sly-edit-definition
+ "gR" #'sly-who-calls)
+
+ (leader
+ "tS" #'+shell/toggle-sly)
+ (local-leader
+ :keymaps '(lisp-mode-map sly-mrepl-mode-map)
+ "s" #'+shell/toggle-sly
+ "c" #'sly-compile-file
+ "a" #'sly-apropos
+ "d" #'sly-describe-symbol)
+ (local-leader
+ :keymaps 'lisp-mode-map
+ :infix "e"
+ "b" #'sly-eval-buffer
+ "e" #'sly-eval-last-expression
+ "f" #'sly-eval-defun
+ "r" #'sly-eval-region)
+ ; sly binds
+ (nmap
+ :keymaps 'sly-inspector-mode-map
+ "q" #'sly-inspector-quit))
+#+end_src
+*** Lisp indent function
Add a new lisp indent function which indents newline lists more
appropriately.
#+begin_src emacs-lisp
(use-package lisp-mode
:straight nil
:pretty
- (emacs-lisp-mode-hook
+ (lisp-mode-hook
("lambda" . "λ")
("t" . "⊨")
("nil" . "Ø")
@@ -2873,5 +2926,5 @@ appropriately.
indent-point normal-indent))
(method
(funcall method indent-point state))))))))
- (add-hook 'emacs-lisp-mode-hook (proc (interactive) (setq-local lisp-indent-function #'+dx/lisp-indent-function))))
+ (setq-default lisp-indent-function #'+dx/lisp-indent-function))
#+end_src