Actually add the emacs-lisp folder :-)
This commit is contained in:
parent
6238c7dfad
commit
18762615ae
57
contrib/lang/emacs-lisp/README.md
Normal file
57
contrib/lang/emacs-lisp/README.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
# Emacs Lisp contribution layer for Spacemacs
|
||||
|
||||
![logo](img/emacs-lisp.png)
|
||||
|
||||
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
|
||||
**Table of Contents**
|
||||
|
||||
- [Emacs Lisp contribution layer for Spacemacs](#emacs-lisp-contribution-layer-for-spacemacs)
|
||||
- [Description](#description)
|
||||
- [Install](#install)
|
||||
- [Key bindings](#key-bindings)
|
||||
- [srefactor](#srefactor)
|
||||
|
||||
<!-- markdown-toc end -->
|
||||
|
||||
## Description
|
||||
|
||||
This layer gathers all the configuration related to emacs-lisp. This should
|
||||
always be in your dotfile, it is not recommended to uninstall it.
|
||||
|
||||
## Install
|
||||
|
||||
To use this contribution add it to your `~/.spacemacs`
|
||||
|
||||
```elisp
|
||||
(setq-default dotspacemacs-configuration-layers '(emacs-lisp))
|
||||
```
|
||||
|
||||
## Key bindings
|
||||
|
||||
Key Binding | Description
|
||||
---------------------------------------------|-------------------------------------------
|
||||
<kbd>SPC m g g</kbd> | go to definition of symbol under point
|
||||
<kbd>SPC m h h</kbd> | describe symbol at point
|
||||
<kbd>SPC m e $</kbd> or <kbd>SPC m e l</kbd> | go to end of current line and evaluate
|
||||
<kbd>SPC m e b</kbd> | evaluate current buffer
|
||||
<kbd>SPC m e c</kbd> | evaluate current form (start with `defun`, `setq`, etc...)
|
||||
<kbd>SPC m e e</kbd> | evaluate sexp before point
|
||||
<kbd>SPC m e r</kbd> | evaluate current region
|
||||
<kbd>SPC m e f</kbd> | evaluation current function
|
||||
<kbd>SPC m ,</kbd> | toggle `lisp state`
|
||||
<kbd>SPC m t b</kbd> | run tests of current buffer
|
||||
<kbd>SPC m t q</kbd> | run `ert`
|
||||
|
||||
### srefactor
|
||||
|
||||
The [semantic layer][semantic-layer] should be installed for these key bindings
|
||||
to become active.
|
||||
|
||||
Key Binding | Description
|
||||
---------------------|------------------------------------------------------------
|
||||
<kbd>SPC m = b</kbd> | format current buffer
|
||||
<kbd>SPC m = f</kbd> | format current function
|
||||
<kbd>SPC m = r</kbd> | format current sexp
|
||||
<kbd>SPC m = o</kbd> | format all on one line
|
||||
|
||||
[semantic-layer]: ../../semantic/README.md
|
14
contrib/lang/emacs-lisp/config.el
Normal file
14
contrib/lang/emacs-lisp/config.el
Normal file
|
@ -0,0 +1,14 @@
|
|||
;;; config.el --- Emacs Lisp Layer configuration File for Spacemacs
|
||||
;;
|
||||
;; Copyright (c) 2012-2014 Sylvain Benner
|
||||
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
||||
;;
|
||||
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
;; Variables
|
||||
(spacemacs|defvar-company-backends emacs-lisp-mode)
|
33
contrib/lang/emacs-lisp/extensions.el
Normal file
33
contrib/lang/emacs-lisp/extensions.el
Normal file
|
@ -0,0 +1,33 @@
|
|||
;;; extensions.el --- Emacs Lisp Layer Extensions File for Spacemacs
|
||||
;;
|
||||
;; Copyright (c) 2012-2014 Sylvain Benner
|
||||
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
||||
;;
|
||||
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(setq emacs-lisp-post-extensions
|
||||
'(emacs-builtin-emacs-lisp))
|
||||
|
||||
(defun emacs-lisp/init-emacs-builtin-emacs-lisp ()
|
||||
|
||||
(evil-leader/set-key-for-mode 'emacs-lisp-mode
|
||||
"me$" 'lisp-state-eval-sexp-end-of-line
|
||||
"meb" 'eval-buffer
|
||||
"mec" 'spacemacs/eval-current-form
|
||||
"mee" 'eval-last-sexp
|
||||
"mer" 'spacemacs/eval-region
|
||||
"mef" 'eval-defun
|
||||
"mel" 'lisp-state-eval-sexp-end-of-line
|
||||
"m," 'lisp-state-toggle-lisp-state
|
||||
"mtb" 'spacemacs/ert-run-tests-buffer
|
||||
"mtq" 'ert)
|
||||
|
||||
;; company support
|
||||
(push 'company-capf company-backends-emacs-lisp-mode)
|
||||
(spacemacs|add-company-hook emacs-lisp-mode))
|
||||
|
BIN
contrib/lang/emacs-lisp/img/emacs-lisp.png
Normal file
BIN
contrib/lang/emacs-lisp/img/emacs-lisp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
63
contrib/lang/emacs-lisp/packages.el
Normal file
63
contrib/lang/emacs-lisp/packages.el
Normal file
|
@ -0,0 +1,63 @@
|
|||
;;; packages.el --- Emacs Lisp Layer packages File for Spacemacs
|
||||
;;
|
||||
;; Copyright (c) 2012-2014 Sylvain Benner
|
||||
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
|
||||
;;
|
||||
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
||||
;; URL: https://github.com/syl20bnr/spacemacs
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(setq emacs-lisp-packages
|
||||
'(
|
||||
eldoc
|
||||
elisp-slime-nav
|
||||
evil
|
||||
semantic
|
||||
smartparens
|
||||
srefactor
|
||||
))
|
||||
|
||||
(defun emacs-lisp/post-init-eldoc ()
|
||||
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode))
|
||||
|
||||
(defun emacs-lisp/init-elisp-slime-nav ()
|
||||
;; Elisp go-to-definition with M-. and back again with M-,
|
||||
(use-package elisp-slime-nav
|
||||
:defer t
|
||||
:init
|
||||
(progn
|
||||
(add-hook 'emacs-lisp-mode-hook 'elisp-slime-nav-mode)
|
||||
(evil-leader/set-key-for-mode 'emacs-lisp-mode
|
||||
"mgg" 'elisp-slime-nav-find-elisp-thing-at-point
|
||||
"mhh" 'elisp-slime-nav-describe-elisp-thing-at-point))))
|
||||
|
||||
(defun emacs-lisp/post-init-evil ()
|
||||
(add-to-hook 'emacs-lisp-mode
|
||||
'(lambda ()
|
||||
(spacemacs|define-text-object ";"
|
||||
"elisp-comment"
|
||||
";; "
|
||||
""))))
|
||||
|
||||
(defun emacs-lisp/post-init-semantic ()
|
||||
(semantic/enable-semantic-mode 'emacs-lisp-mode)
|
||||
(eval-after-load 'semantic
|
||||
'(semantic-default-elisp-setup)))
|
||||
|
||||
(defun emacs-lisp/post-init-srefactor ()
|
||||
(add-hook 'emacs-lisp-mode-hook 'spacemacs/lazy-load-srefactor)
|
||||
(use-package srefactor-lisp
|
||||
:commands (srefactor-lisp-format-buffer
|
||||
srefactor-lisp-format-defun
|
||||
srefactor-lisp-format-sexp
|
||||
srefactor-lisp-one-line)
|
||||
:init
|
||||
(evil-leader/set-key-for-mode 'emacs-lisp-mode
|
||||
"mfb" 'srefactor-lisp-format-buffer
|
||||
"mfd" 'srefactor-lisp-format-defun
|
||||
"mfr" 'srefactor-lisp-format-sexp
|
||||
"mfo" 'srefactor-lisp-one-line
|
||||
)))
|
Loading…
Reference in a new issue