NonGNU-devel ELPA - evil-lisp-state

evil-lisp-state

Description
An evil state to edit Lisp code
Latest
evil-lisp-state-8.2.0.20160403.224859.tar, 2022-Jan-06, 60.0 KiB
Maintainer
Sylvain Benner <sylvain.benner@gmail.com>
Home page
https://github.com/syl20bnr/evil-lisp-state
Browse ELPA's repository
CGit or Gitweb
Badge

To install this package, run in Emacs:

M-x package-install RET evil-lisp-state RET

Full description

evil-lisp-state

MELPA

Adds a new evil state to navigate lisp code and edit sexp trees using mnemonic key bindings.

**Table of Contents** - [evil-lisp-state](#evil-lisp-state) - [Install](#install) - [Package manager](#package-manager) - [Manually](#manually) - [Principle](#principle) - [Commands and key bindings](#commands-and-key-bindings) - [Configuration](#configuration)

Install

Package manager

You can either install evil-lisp-state from MELPA:

M-x package-install evil-lisp-state

Or add it to your Cask file:

```elisp (source melpa)

(depends-on "evil-lisp-state") ```

Manually

Add evil-lisp-state.el to your load path. evil-lisp-state requires both evil, bind-map and smartparens to be installed.

Principle

To execute a command while in normal state, a leader key is used. The leader has to be defined with the function evil-lisp-state-leader. By default any command when executed sets the current state to lisp state.

Examples:

  • to slurp three times while in normal state:

    3 s

  • to wrap a symbol in parenthesis then slurping two times:

    w 2 s

Key Bindings

Key Binding | Function --------------------------|------------------------------------------------------------ \ . | switch to lisp state \ % | evil jump item \ : | ex command \ ( | insert expression before (same level as current one) \ ) | insert expression after (same level as current one) \ $ | go to the end of current sexp \ k</kbd> | hybrid version of kill sexp (can be used in non lisp dialects) <kbd>\<leader\> p | hybrid version of push sexp (can be used in non lisp dialects) \ s</kbd> | hybrid version of slurp sexp (can be used in non lisp dialects) <kbd>\<leader\> t | hybrid version of transpose sexp (can be used in non lisp dialects) \ 0 | go to the beginning of current sexp \ a | absorb expression \ b | forward barf expression \ B | backward barf expression \ c | convolute expression \ ds | delete symbol \ Ds | backward delete symbol \ dw | delete word \ Dw | backward delete word \ dx | delete expression \ Dx | backward delete expression \ e | unwrap current expression and kill all symbols after point \ E | unwrap current expression and kill all symbols before point \ h | previous symbol \ H | go to previous sexp \ i | switch to insert state \ I | go to beginning of current expression and switch to insert state \ j | next closing parenthesis \ J | join expression \ k | previous opening parenthesis \ l | next symbol \ L | go to next sexp \ p | paste after \ P | paste before \ r | raise expression (replace parent expression by current one) \ s | forwared slurp expression \ S | backward slurp expression \ t | transpose expression \ u | undo \ U | got to parent sexp backward \ C-r | redo \ v | switch to visual state \ V | switch to visual line state \ C-v | switch to visual block state \ w | wrap expression with parenthesis \ W | unwrap expression \ y | copy expression

Configuration

No default binding comes with the package, you have to explicitly bind the lisp state to a key with the function evil-lisp-state-leader For instance:

elisp (evil-lisp-state-leader ", l")

Key bindings are set only for emacs-lisp-mode by default. It is possible to add major modes with the variable `evil-lisp-state-major-modes'.

It is also possible to define the key bindings globally by setting evil-lisp-state-global to t. In this case `evil-lisp-state-major-modes' has no effect.

If you don't want commands to enter in lisp state by default set the variable evil-lisp-state-enter-lisp-state-on-command to nil. Then use the . to enter manually in lisp state