slime layer: update key bindings and populate README

This commit is contained in:
syl20bnr 2015-06-21 23:46:36 -04:00
parent a40bc74576
commit 363808abf4
2 changed files with 71 additions and 49 deletions

View File

@ -6,8 +6,11 @@
- [[#description][Description]]
- [[#install][Install]]
- [[#key-bindings][Key Bindings]]
- [[#future-work][Future Work]]
- [[#todo-add-proper-spacemacs-keybindings][TODO Add proper Spacemacs keybindings]]
- [[#help][Help]]
- [[#evaluation][Evaluation]]
- [[#repl][REPL]]
- [[#compile][Compile]]
- [[#navigation][Navigation]]
* Description
@ -31,21 +34,45 @@ of Common Lisp, you can specify it in your =~/.spacemacs=
* Key Bindings
This layer doesn't yet include Spacemacsy keybindings.
The following is a list of some of SLIME's default keybindings.
** Help
| Key Binding | Description |
|---------------+------------------------------------------------------|
| ~C-c~ | Prefix Command |
| ~C-c C-k~ | Compile and load the current buffer's file. |
| ~C-c C-c~ | Compile the top-level form at point. |
| ~C-c C-d C-d~ | Describe symbol. |
| ~C-c C-d C-a~ | Apropos search. |
| ~M-n~ | slime-repl-next-input |
| ~M-p~ | slime-repl-previous-input |
| ~C-M-x~ | lisp-eval-defun |
| ~C-h m~ | check emacs mode help for all of SLIME's keybindings |
| Key Binding | Description |
|-------------+--------------------|
| ~SPC m h a~ | SLIME apropos |
| ~SPC m h d~ | Disassemble symbol |
| ~SPC m h h~ | Describe function |
| ~SPC m h H~ | Hyperspec lookup |
* Future Work
** Evaluation
** TODO Add proper Spacemacs keybindings
| Key Binding | Description |
|-------------+---------------------------------|
| ~SPC m e b~ | Evaluate buffer |
| ~SPC m e f~ | Evaluate top level s-expression |
| ~SPC m e e~ | Evaluate last expression |
| ~SPC m e r~ | Evaluate region |
** REPL
| Key Binding | Description |
|-------------+----------------------------------|
| ~SPC m s i~ | Start an inferior process |
| ~SPC m s e~ | Evaluate last expression in REPL |
| ~SPC m s q~ | Quit |
** Compile
| Key Binding | Description |
|-------------+--------------------------|
| ~SPC m c c~ | Compile file |
| ~SPC m c C~ | Compile file and load it |
| ~SPC m c f~ | Compile function |
| ~SPC m c r~ | Compile region |
** Navigation
| Key Binding | Description |
|---------------------------+--------------------|
| ~SPC m g g~ | Inspect definition |
| ~SPC m g n~ | Next note |
| ~SPC m g N~ or ~SPC m g p | Previous note |

View File

@ -23,51 +23,46 @@
slime-sbcl-exts
slime-scratch)
inferior-lisp-program "sbcl")
;; enable fuzzy matching in code buffer and SLIME REPL
(setq slime-complete-symbol*-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
;; enabel smartparen in code buffer and SLIME REPL
;; (add-hook 'slime-repl-mode-hook #'smartparens-strict-mode)
(defun slime/disable-smartparens ()
(smartparens-strict-mode -1)
(turn-off-smartparens-mode))
(add-hook 'slime-repl-mode-hook #'slime/disable-smartparens)
(add-to-hooks 'slime-mode '(lisp-mode-hook scheme-mode-hook)))
:config
(message "loading slime...")
(slime-setup)
(dolist (m `(,slime-mode-map ,slime-repl-mode-map))
(define-key m [(tab)] 'slime-fuzzy-complete-symbol))
(progn
(slime-setup)
(dolist (m `(,slime-mode-map ,slime-repl-mode-map))
(define-key m [(tab)] 'slime-fuzzy-complete-symbol))
(dolist (m '(lisp-mode
scheme-mode))
(evil-leader/set-key-for-mode m
"mcc" 'slime-compile-file
"mcC" 'slime-compile-and-load-file
"mcf" 'slime-compile-defun
"mcr" 'slime-compile-region
(dolist (m '(lisp-mode
scheme-mode))
(evil-leader/set-key-for-mode m
"mdH" 'slime-hyperspec-lookup
"mdd" 'slime-describe-function
"mdD" 'slime-disassemble-symbol
"mda" 'slime-apropos
"meb" 'slime-eval-buffer
"mef" 'slime-eval-defun
"mee" 'slime-eval-last-sexp
"mer" 'slime-eval-region
"meb" 'slime-eval-buffer
"mee" 'slime-eval-last-sexp
"med" 'slime-eval-defun
"mer" 'slime-eval-region
"mgg" 'slime-inspect-definition
"mgn" 'slime-next-note
"mgN" 'slime-previous-note
"mgp" 'slime-previous-note
"mcf" 'slime-compile-and-load-file
"mcF" 'slime-compile-file
"mcd" 'slime-compile-defun
"mcr" 'slime-compile-region
"mha" 'slime-apropos
"mhd" 'slime-disassemble-symbol
"mhh" 'slime-describe-function
"mhH" 'slime-hyperspec-lookup
"mgn" 'slime-next-note
"mgN" 'slime-previous-note
"mgp" 'slime-previous-note
"mgg" 'slime-inspect-definition
"mse" 'slime-eval-last-expression-in-repl
"msi" 'slime
"msq" 'slime-quit-lisp
"msi" 'slime
"mse" 'slime-eval-last-expression-in-repl
"msq" 'slime-quit-lisp
"mtf" 'slime-toggle-fancy-trace))))
"mtf" 'slime-toggle-fancy-trace)))))