[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-lisp-state 8d58b864ba 003/125: Initial push of evil-l
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-lisp-state 8d58b864ba 003/125: Initial push of evil-lisp-state.el |
Date: |
Thu, 6 Jan 2022 04:58:32 -0500 (EST) |
branch: elpa/evil-lisp-state
commit 8d58b864baca282645044c59b28b3f03216e8641
Author: syl20bnr <sylvain.benner@gmail.com>
Commit: syl20bnr <sylvain.benner@gmail.com>
Initial push of evil-lisp-state.el
---
evil-lisp-state.el | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 96 insertions(+)
diff --git a/evil-lisp-state.el b/evil-lisp-state.el
new file mode 100644
index 0000000000..8c43c855a1
--- /dev/null
+++ b/evil-lisp-state.el
@@ -0,0 +1,96 @@
+;;; evil-lisp-state.el --- Add an evil state to navigate Lisp code and edit
the sexp tree with mnemonic key bindings using smartparens.
+
+;; Copyright (C) 2014 syl20bnr
+
+;; Author: Sylvain Benner <sylvain.benner@gmail.com>
+;; Keywords: convenience editing evil smartparens lisp mnemonic
+;; Created: 9 Oct 2014
+;; Version: 1.0
+;; Package-Requires: ((evil "1.0.9") (smartparens "1.6.1"))
+;; URL: https://github.com/syl20bnr/evil-lisp-state
+
+;; This file is not part of GNU Emacs.
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Adds a new Evil state called --LISP-- (<L>) with mnemonics key bindings
+;; to navigate Lisp code and edit the sexp tree.
+
+;; Configuration example:
+;; (add-hook)
+
+;; More information on the Github repository:
+;; https://github.com/syl20bnr/evil-lisp-state
+
+;;; Code:
+
+(require 'evil)
+(require 'smartparens)
+
+(evil-define-state lisp
+ "Lisp state.
+ Used to navigate lisp code and manipulate the sexp tree."
+ :tag " <L> "
+ :cursor (bar . 2)
+ ;; force smartparens mode
+ (if (evil-lisp-state-p) (smartparens-mode)))
+
+;; key bindings
+(define-key evil-lisp-state-map "1" 'digit-argument)
+(define-key evil-lisp-state-map "2" 'digit-argument)
+(define-key evil-lisp-state-map "3" 'digit-argument)
+(define-key evil-lisp-state-map "4" 'digit-argument)
+(define-key evil-lisp-state-map "5" 'digit-argument)
+(define-key evil-lisp-state-map "6" 'digit-argument)
+(define-key evil-lisp-state-map "7" 'digit-argument)
+(define-key evil-lisp-state-map "8" 'digit-argument)
+(define-key evil-lisp-state-map "9" 'digit-argument)
+(define-key evil-lisp-state-map "$" 'sp-end-of-sexp)
+(define-key evil-lisp-state-map "0" 'sp-beginning-of-sexp)
+(define-key evil-lisp-state-map "bh" 'sp-backward-barf-sexp)
+(define-key evil-lisp-state-map "bl" 'sp-forward-barf-sexp)
+(define-key evil-lisp-state-map "c" 'sp-convolute-sexp)
+(define-key evil-lisp-state-map "d" 'sp-kill-sexp)
+(define-key evil-lisp-state-map "e$" 'evil-lisp-state-eval-sexp-end-of-line)
+(define-key evil-lisp-state-map "ef" 'eval-defun)
+(define-key evil-lisp-state-map "el" 'eval-last-sexp)
+(define-key evil-lisp-state-map "es" 'eval-sexp)
+(define-key evil-lisp-state-map "h" 'sp-backward-sexp)
+(define-key evil-lisp-state-map "i" 'evil-insert-state)
+(define-key evil-lisp-state-map "j" 'sp-down-sexp)
+(define-key evil-lisp-state-map "J" 'sp-backward-down-sexp)
+(define-key evil-lisp-state-map "k" 'sp-up-sexp)
+(define-key evil-lisp-state-map "K" 'sp-backward-up-sexp)
+(define-key evil-lisp-state-map "l" 'sp-forward-sexp)
+(define-key evil-lisp-state-map "r" 'sp-raise-sexp)
+(define-key evil-lisp-state-map "C-r" 'undo-tree-redo)
+(define-key evil-lisp-state-map "sa" 'sp-splice-sexp-killing-around)
+(define-key evil-lisp-state-map "sb" 'sp-splice-sexp-killing-backward)
+(define-key evil-lisp-state-map "sf" 'sp-splice-sexp-killing-forward)
+(define-key evil-lisp-state-map "sh" 'sp-backward-slurp-sexp)
+(define-key evil-lisp-state-map "sl" 'sp-forward-slurp-sexp)
+(define-key evil-lisp-state-map "ss" 'sp-splice-sexp)
+(define-key evil-lisp-state-map "u" 'undo-tree-undo)
+(define-key evil-lisp-state-map [escape] 'evil-normal-state)
+
+(defun evil-lisp-state-eval-sexp-end-of-line ()
+ "Evaluate the last sexp at the end of the current line."
+ (interactive)
+ (save-excursion
+ (evil-end-of-line)
+ (eval-last-sexp nil)))
+
+(provide 'evil-lisp-state)
- [nongnu] branch elpa/evil-lisp-state created (now 3c65fecd99), ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 8a44cdcffe 001/125: Initial commit, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 8d58b864ba 003/125: Initial push of evil-lisp-state.el,
ELPA Syncer <=
- [nongnu] elpa/evil-lisp-state c0033214de 006/125: Merge pull request #1 from purcell/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 742da3fe8b 007/125: Update readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state a44023b712 009/125: Change prefix for sp-splice-sexp-killing-xxx to `sk_`, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 9dfc5fe116 002/125: Update gitignore, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 9be14079e5 004/125: Update readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 7b5937a327 005/125: Shorten package description, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 729c131ecc 012/125: Better consistency with `sx` for sp-splice-sexp, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state f9fad45551 011/125: Add key bindings for sp-kill-sexp functions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 9afc34bd94 016/125: Add yank/past on `y` and `p`, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-lisp-state 95204dcf71 018/125: Add key bindings for wrapping functions and symbol navigation, ELPA Syncer, 2022/01/06