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 (.sig), 2024-Mar-31, 70.0 KiB
Maintainer
Sylvain Benner <sylvain.benner@gmail.com>
Atom feed
evil-lisp-state.xml
Website
https://github.com/syl20bnr/evil-lisp-state
Browse ELPA's repository
CGit or Gitweb
Badge

To install this package from Emacs, use package-install or list-packages.

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

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
\ hybrid version of kill sexp (can be used in non lisp dialects)
\ hybrid version of push sexp (can be used in non lisp dialects)
\ hybrid version of slurp sexp (can be used in non lisp dialects)
\ hybrid version of transpose sexp (can be used in non lisp dialects)
\ go to the beginning of current sexp
\ absorb expression
\ forward barf expression
\ backward barf expression
\ convolute expression
\ delete symbol
\ backward delete symbol
\ delete word
\ backward delete word
\ delete expression
\ backward delete expression
\ unwrap current expression and kill all symbols after point
\ unwrap current expression and kill all symbols before point
\ previous symbol
\ go to previous sexp
\ switch to insert state
\ go to beginning of current expression and switch to insert state
\ next closing parenthesis
\ join expression
\ previous opening parenthesis
\ next symbol
\ go to next sexp
\ paste after
\ paste before
\ raise expression (replace parent expression by current one)
\ forwared slurp expression
\ backward slurp expression
\ transpose expression
\ undo
\ got to parent sexp backward
\ redo
\ switch to visual state
\ switch to visual line state
\ switch to visual block state
\ wrap expression with parenthesis
\ unwrap expression
\ 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