{"id":13646636,"url":"https://github.com/abo-abo/lispy","last_synced_at":"2025-05-15T18:07:32.357Z","repository":{"id":13121746,"uuid":"15803613","full_name":"abo-abo/lispy","owner":"abo-abo","description":"Short and sweet LISP editing","archived":false,"fork":false,"pushed_at":"2024-07-07T09:00:10.000Z","size":5321,"stargazers_count":1240,"open_issues_count":176,"forks_count":136,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-31T21:51:21.103Z","etag":null,"topics":["clojure","common-lisp","emacs-lisp","evaluation","navigation","python","refactoring","scheme"],"latest_commit_sha":null,"homepage":"http://oremacs.com/lispy/","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abo-abo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"liberapay":"abo-abo","patreon":"abo_abo"}},"created_at":"2014-01-10T16:45:29.000Z","updated_at":"2025-03-24T13:02:31.000Z","dependencies_parsed_at":"2024-11-21T04:02:17.028Z","dependency_job_id":null,"html_url":"https://github.com/abo-abo/lispy","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abo-abo%2Flispy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abo-abo%2Flispy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abo-abo%2Flispy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abo-abo%2Flispy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abo-abo","download_url":"https://codeload.github.com/abo-abo/lispy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247737788,"owners_count":20987721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","common-lisp","emacs-lisp","evaluation","navigation","python","refactoring","scheme"],"created_at":"2024-08-02T01:03:01.580Z","updated_at":"2025-04-07T22:11:21.154Z","avatar_url":"https://github.com/abo-abo.png","language":"Emacs Lisp","readme":"[![License GPL 3][badge-license]](http://www.gnu.org/licenses/gpl-3.0.txt)\n[![Build Status](https://travis-ci.org/abo-abo/lispy.svg?branch=master)](https://travis-ci.org/abo-abo/lispy)\n[![Coverage Status](https://coveralls.io/repos/abo-abo/lispy/badge.svg?branch=master)](https://coveralls.io/r/abo-abo/lispy?branch=master)\n[![MELPA](http://melpa.org/packages/lispy-badge.svg)](http://melpa.org/#/lispy)\n[![MELPA Stable](http://stable.melpa.org/packages/lispy-badge.svg)](http://stable.melpa.org/#/lispy)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/abo-abo/lispy/master/images/lispy-logo.png\"\n   alt=\"lispy logo\"/\u003e\n\u003c/p\u003e\n\n\u003e short and sweet LISP editing\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again --\u003e\n**Table of Contents**\n\n- [Introduction](#introduction)\n    - [Relation to vi](#relation-to-vi)\n    - [Features](#features)\n    - [Function reference](#function-reference)\n- [Getting Started](#getting-started)\n    - [Installation instructions](#installation-instructions)\n        - [via MELPA](#via-melpa)\n        - [via el-get](#via-el-get)\n    - [Configuration instructions](#configuration-instructions)\n    - [Customization instructions](#customization-instructions)\n- [Operating on lists](#operating-on-lists)\n    - [How to get into list-editing mode (special)](#how-to-get-into-list-editing-mode-special)\n    - [Digit keys in special](#digit-keys-in-special)\n    - [How to get out of special](#how-to-get-out-of-special)\n    - [List commands overview](#list-commands-overview)\n        - [Inserting pairs](#inserting-pairs)\n        - [Reversible commands](#reversible-commands)\n        - [Keys that modify whitespace](#keys-that-modify-whitespace)\n        - [Command chaining](#command-chaining)\n        - [Navigating with `avy`-related commands](#navigating-with-ace-jump-mode-related-commands)\n- [Operating on regions](#operating-on-regions)\n    - [Ways to activate region](#ways-to-activate-region)\n    - [Move region around](#move-region-around)\n    - [Switch to the other side of the region](#switch-to-the-other-side-of-the-region)\n    - [Grow/shrink region](#growshrink-region)\n    - [Commands that operate on region](#commands-that-operate-on-region)\n- [IDE-like features](#ide-like-features)\n- [Demos](#demos)\n    - [[Demo 1: Practice generating code](http://abo-abo.github.io/lispy/demo-1)](#demo-1-practice-generating-codehttpabo-abogithubiolispydemo-1)\n    - [[Demo 2: The substitution model for procedure application](http://abo-abo.github.io/lispy/demo-2)](#demo-2-the-substitution-model-for-procedure-applicationhttpabo-abogithubiolispydemo-2)\n    - [[Demo 3: Down the rabbit hole](http://abo-abo.github.io/lispy/demo-3)](#demo-3-down-the-rabbit-holehttpabo-abogithubiolispydemo-3)\n    - [[Demo 4: Project Euler p100 and Clojure](http://abo-abo.github.io/lispy/demo-4)](#demo-4-project-euler-p100-and-clojurehttpabo-abogithubiolispydemo-4)\n    - [[Demo 5: -\u003e\u003eification](http://abo-abo.github.io/lispy/demo-5)](#demo-5--ificationhttpabo-abogithubiolispydemo-5)\n    - [[Demo 6: cond-\u003eif-\u003econd](http://abo-abo.github.io/lispy/demo-6)](#demo-6-cond-if-condhttpabo-abogithubiolispydemo-6)\n- [Screencasts](#screencasts)\n\n\u003c!-- markdown-toc end --\u003e\n\n# Introduction\n\nThis package reimagines Paredit - a popular method to navigate and\nedit LISP code in Emacs.\n\nThe killer-feature are the short bindings:\n\n|       command                |   binding        |  binding     | command\n|:-----------------------------|:----------------:|:------------:|:------------------\n|`paredit-forward`             | \u003ckbd\u003eC-M-f\u003c/kbd\u003e | \u003ckbd\u003ej\u003c/kbd\u003e | `lispy-down`\n|`paredit-backward`            | \u003ckbd\u003eC-M-b\u003c/kbd\u003e | \u003ckbd\u003ek\u003c/kbd\u003e | `lispy-up`\n|`paredit-backward-up`         | \u003ckbd\u003eC-M-u\u003c/kbd\u003e | \u003ckbd\u003eh\u003c/kbd\u003e | `lispy-left`\n|`paredit-forward-up`          | \u003ckbd\u003eC-M-n\u003c/kbd\u003e | \u003ckbd\u003el\u003c/kbd\u003e | `lispy-right`\n|`paredit-raise-sexp`          | \u003ckbd\u003eM-r\u003c/kbd\u003e   | \u003ckbd\u003er\u003c/kbd\u003e | `lispy-raise`\n|`paredit-convolute-sexp`      | \u003ckbd\u003eM-?\u003c/kbd\u003e   | \u003ckbd\u003eC\u003c/kbd\u003e | `lispy-convolute`\n|`paredit-forward-slurp-sexp`  | \u003ckbd\u003eC-)\u003c/kbd\u003e   | \u003ckbd\u003e\u003e\u003c/kbd\u003e | `lispy-slurp`\n|`paredit-forward-barf-sexp`   | \u003ckbd\u003eC-}\u003c/kbd\u003e   | \u003ckbd\u003e\u003c\u003c/kbd\u003e | `lispy-barf`\n|`paredit-backward-slurp-sexp` | \u003ckbd\u003eC-(\u003c/kbd\u003e   | \u003ckbd\u003e\u003e\u003c/kbd\u003e | `lispy-slurp`\n|`paredit-backward-barf-sexp`  | \u003ckbd\u003eC-{\u003c/kbd\u003e   | \u003ckbd\u003e\u003c\u003c/kbd\u003e | `lispy-barf`\n\nMost of more than 100 interactive commands that `lispy` provides are\nbound to \u003ckbd\u003ea\u003c/kbd\u003e-\u003ckbd\u003ez\u003c/kbd\u003e and \u003ckbd\u003eA\u003c/kbd\u003e-\u003ckbd\u003eZ\u003c/kbd\u003e in\n`lispy-mode`.  You can see the full command reference with many\nexamples [here](http://abo-abo.github.io/lispy/).\n\nThe price for these short bindings is that they are only active when:\n\n- the point is before an open paren: `(`, `[` or `{`\n- the point is after a close paren: `)`, `]` or `}`\n- the region is active\n\nThe advantage of short bindings is that you are more likely to use\nthem.  As you use them more, you learn how to combine them, increasing\nyour editing efficiency.\n\nTo further facilitate building complex commands from smaller commands,\n`lispy-mode` binds `digit-argument` to \u003ckbd\u003e0\u003c/kbd\u003e-\u003ckbd\u003e9\u003c/kbd\u003e.  For\nexample, you can mark the third element of the list with\n\u003ckbd\u003e3m\u003c/kbd\u003e.  You can then mark third through fifth element (three\ntotal) with \u003ckbd\u003e2\u003e\u003c/kbd\u003e or \u003ckbd\u003e\u003e\u003e\u003c/kbd\u003e. You can then move the\nselection to the last three elements of the list with \u003ckbd\u003e99j\u003c/kbd\u003e.\n\nIf you are currently using Paredit, note that `lispy-mode` and\n`paredit-mode` can actually coexist with very few conflicts, although\nthere would be some redundancy.\n\n## Relation to vi\n\nThe key binding method is influenced by vi, although this isn't modal\nediting *per se*.\n\nHere's a quote from Wikipedia on how vi works, in case you don't know:\n\n\u003e vi is a modal editor: it operates in either insert mode (where typed\n\u003e text becomes part of the document) or normal mode (where keystrokes\n\u003e are interpreted as commands that control the edit session). For\n\u003e example, typing i while in normal mode switches the editor to insert\n\u003e mode, but typing i again at this point places an \"i\" character in\n\u003e the document. From insert mode, pressing ESC switches the editor\n\u003e back to normal mode.\n\nHere's an illustration of Emacs, vi and lispy bindings for inserting a\nchar and calling a command:\n\n|                  | insert \"j\"     | forward-list\n|------------------|:--------------:|:-------------:\n|Emacs             | \u003ckbd\u003ej\u003c/kbd\u003e   | \u003ckbd\u003eC-M-n\u003c/kbd\u003e\n|vi in insert mode | \u003ckbd\u003ej\u003c/kbd\u003e   | impossible\n|vi in normal mode | impossible     | \u003ckbd\u003ej\u003c/kbd\u003e\n|lispy             | \u003ckbd\u003ej\u003c/kbd\u003e   | \u003ckbd\u003ej\u003c/kbd\u003e\n\nAdvantages/disadvantages:\n\n- Emacs can both insert and call commands without switching modes (since it has none),\n  but the command bindings are long\n- vi has short command bindings, but you have to switch modes between inserting and calling commands\n- lispy has short command bindings and doesn't need to switch modes\n\nOf course it's not magic, lispy needs to have normal/insert mode to\nperform both functions with \u003ckbd\u003ej\u003c/kbd\u003e.  The difference from vi is\nthat the mode is **explicit** instead of **implicit** - it's\ndetermined by the point position or the region state:\n\n- you are in normal mode when the point is before/after paren or the\n  region is active\n- otherwise you are in insert mode\n\nSo people who generally like Emacs bindings (like me) can have the\ncake and eat it too (no dedicated insert mode + shorter key bindings).\nWhile people who like vi can still get an experience that's reasonably\nclose to vi for LISP editing (since vi's line-based approach isn't\nvery appropriate for LISP anyway).\n\nBut if you ask:\n\n\u003e What if I want to insert when the point is before/after paren or the region is active?\n\nThe answer is that because of the LISP syntax you don't want to write\nthis:\n\n```cl\nj(progn\n   (forward-char 1))k\n```\n\nAlso, Emacs does nothing special by default when the region is active\nand you press a normal key, so new commands can be called in that\nsituation.\n\n## Features\n\n- Basic navigation by-list and by-region:\n    - \u003ckbd\u003eh\u003c/kbd\u003e moves left\n    - \u003ckbd\u003ej\u003c/kbd\u003e moves down\n    - \u003ckbd\u003ek\u003c/kbd\u003e moves up\n    - \u003ckbd\u003el\u003c/kbd\u003e moves right\n    - \u003ckbd\u003ef\u003c/kbd\u003e steps inside the list\n    - \u003ckbd\u003eb\u003c/kbd\u003e moves back in history for all above commands\n\n- Paredit transformations, callable by plain letters:\n    - \u003ckbd\u003e\u003e\u003c/kbd\u003e slurps\n    - \u003ckbd\u003e\u003c\u003c/kbd\u003e barfs\n    - \u003ckbd\u003er\u003c/kbd\u003e raises\n    - \u003ckbd\u003eC\u003c/kbd\u003e convolutes\n    - \u003ckbd\u003es\u003c/kbd\u003e moves down\n    - \u003ckbd\u003ew\u003c/kbd\u003e moves up\n- IDE-like features for Elisp, Clojure, Scheme, Common Lisp, Hy, Python and Julia:\n    - \u003ckbd\u003ee\u003c/kbd\u003e evals\n    - \u003ckbd\u003eE\u003c/kbd\u003e evals and inserts\n    - \u003ckbd\u003eg\u003c/kbd\u003e jumps to any tag in the current directory with semantic\n    - \u003ckbd\u003eG\u003c/kbd\u003e jumps to any tag in the current file\n    - \u003ckbd\u003eM-.\u003c/kbd\u003e jumps to symbol, \u003ckbd\u003eM-,\u003c/kbd\u003e jumps back\n    - \u003ckbd\u003eF\u003c/kbd\u003e jumps to symbol, \u003ckbd\u003eD\u003c/kbd\u003e jumps back\n    - \u003ckbd\u003eC-1\u003c/kbd\u003e shows documentation in an overlay\n    - \u003ckbd\u003eC-2\u003c/kbd\u003e shows arguments in an overlay\n    - [\u003ckbd\u003eZ\u003c/kbd\u003e](http://abo-abo.github.io/lispy/#lispy-edebug-stop) breaks\n      out of `edebug`, while storing current function's arguments\n\nSome pictures [here](#ide-like-features).\n- Code manipulation:\n    - \u003ckbd\u003ei\u003c/kbd\u003e prettifies code (remove extra space, hanging parens ...)\n    - \u003ckbd\u003exi\u003c/kbd\u003e transforms `cond` expression to equivalent `if` expressions\n    - \u003ckbd\u003exc\u003c/kbd\u003e transforms `if` expressions to an equivalent `cond` expression\n    - \u003ckbd\u003ex\u003e\u003c/kbd\u003e transforms expressions from/to an equivalent `thread-last` expression\n    - \u003ckbd\u003exf\u003c/kbd\u003e flattens function or macro call (extract body and substitute arguments)\n    - \u003ckbd\u003exr\u003c/kbd\u003e evals and replaces\n    - \u003ckbd\u003exl\u003c/kbd\u003e turns current `defun` into a `lambda`\n    - \u003ckbd\u003exd\u003c/kbd\u003e turns current `lambda` into a `defun`\n    - \u003ckbd\u003eO\u003c/kbd\u003e formats the code into one line\n    - \u003ckbd\u003eM\u003c/kbd\u003e formats the code into multiple lines\n- Misc. bindings:\n    - outlines navigation/folding (\u003ckbd\u003eJ\u003c/kbd\u003e, \u003ckbd\u003eK\u003c/kbd\u003e, \u003ckbd\u003eI\u003c/kbd\u003e, \u003ckbd\u003ei\u003c/kbd\u003e)\n    - narrow/widen (\u003ckbd\u003eN\u003c/kbd\u003e, \u003ckbd\u003eW\u003c/kbd\u003e)\n    - `ediff` (\u003ckbd\u003eb\u003c/kbd\u003e, \u003ckbd\u003eB\u003c/kbd\u003e)\n    - `ert` (\u003ckbd\u003eT\u003c/kbd\u003e)\n    - `edebug` (\u003ckbd\u003exe\u003c/kbd\u003e)\n\n## Function reference\nMost functions are cataloged and described at http://abo-abo.github.io/lispy/.\n\n# Getting Started\n## Installation instructions\n### via MELPA\n\nIt's easiest/recommended to install from [MELPA](http://melpa.org/).\nHere's a minimal MELPA configuration for your `~/.emacs`:\n\n```cl\n(package-initialize)\n(add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))\n```\n\nAfterwards, \u003ckbd\u003eM-x package-install RET lispy RET\u003c/kbd\u003e (you might\nwant to \u003ckbd\u003eM-x package-refresh-contents RET\u003c/kbd\u003e beforehand if\nyou haven't done so recently).\n\n### via el-get\n\n[el-get](https://github.com/dimitri/el-get) also features a lispy recipe.\nUse \u003ckbd\u003eM-x el-get-install RET lispy RET\u003c/kbd\u003e to install.\n\n## Configuration instructions\n**Enable lispy automatically for certain modes**\n\nAfter installing, you can call \u003ckbd\u003eM-x lispy-mode\u003c/kbd\u003e for any\nbuffer with a LISP dialect source.  To have `lispy-mode` activated\nautomatically, use something like this:\n\n\n```cl\n(add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1)))\n```\n\n**Enable lispy for `eval-expression`**\n\nAlthough I prefer to eval things in `*scratch*`, sometimes\n\u003ckbd\u003eM-:\u003c/kbd\u003e - `eval-expression` is handy.  Here's how to use lispy\nin the minibuffer during `eval-expression`:\n\n```cl\n(defun conditionally-enable-lispy ()\n  (when (eq this-command 'eval-expression)\n    (lispy-mode 1)))\n(add-hook 'minibuffer-setup-hook 'conditionally-enable-lispy)\n```\n\n## Customization instructions\n\nIf you want to replace some of the `lispy-mode`'s bindings you can do\nit like this:\n\n```cl\n(eval-after-load \"lispy\"\n  `(progn\n     ;; replace a global binding with own function\n     (define-key lispy-mode-map (kbd \"C-e\") 'my-custom-eol)\n     ;; replace a global binding with major-mode's default\n     (define-key lispy-mode-map (kbd \"C-j\") nil)\n     ;; replace a local binding\n     (lispy-define-key lispy-mode-map \"s\" 'lispy-down)))\n```\n\n## Compatibility with other modes\n\nUse the `lispy-compat` variable to enable compatibility with modes that could otherwise conflict. These currently include:\n\n- god-mode\n- magit-blame-mode\n- edebug\n- cider\n- macrostep\n\nThe default setting only enables compatibility with `edebug`.\n\n# Operating on lists\n\n## How to get into list-editing mode (special)\n\nThe plain keys will call commands when:\n- the point is positioned before paren\n- the point is positioned after paren\n- the region is active\n\nWhen one of the first two conditions is true, I say that the point is\nspecial. When the point is special, it's very clear to which sexp the\nlist-manipulating command will be applied to, what the result be and\nwhere the point should end up afterwards.  You can enhance this effect\nwith `show-paren-mode` or similar.\n\nHere's an illustration to this effect, with `lispy-clone` (here, `|`\nrepresents the point):\n\n|before              | key          | after\n|:-------------------|:------------:|:-----------------------\n|`(looking-at \"(\")\\|` | \u003ckbd\u003ec\u003c/kbd\u003e |  `(looking-at \"(\")`\n|                    |              |  `(looking-at \"(\")\\|`\n\n|before              | key          | after\n|:-------------------|:------------:|:-----------------------\n|`\\|(looking-at \"(\")` | \u003ckbd\u003ec\u003c/kbd\u003e |  `\\|(looking-at \"(\")`\n|                    |              |   ` (looking-at \"(\")`\n\nYou can use plain Emacs navigation commands to get into special, or you can use\nsome of the dedicated commands:\n\nKey Binding     | Description\n----------------|-----------------------------------------------------------\n\u003ckbd\u003e]\u003c/kbd\u003e    | `lispy-forward` - move to the end of the closest list, analogous to \u003ckbd\u003eC-M-n\u003c/kbd\u003e (`forward-list`)\n\u003ckbd\u003e\u0026#91;\u003c/kbd\u003e| `lispy-backward` - move to the start of the closest list, analogous to \u003ckbd\u003eC-M-p\u003c/kbd\u003e (`backward-list`)\n\u003ckbd\u003eC-3\u003c/kbd\u003e  | `lispy-right` - exit current list forwards, analogous to `up-list`\n\u003ckbd\u003e)\u003c/kbd\u003e    | `lispy-right-nostring` exit current list forwards, but self-insert in strings and comments\n\nThese are the few lispy commands that don't care whether the point is\nspecial or not. Other such bindings are \u003ckbd\u003eDEL\u003c/kbd\u003e, \u003ckbd\u003eC-d\u003c/kbd\u003e, \u003ckbd\u003eC-k\u003c/kbd\u003e.\n\nSpecial is useful for manipulating/navigating lists.  If you want to\nmanipulate symbols, use [region selection](#operating-on-regions)\ninstead.\n\n## Digit keys in special\n\nWhen special, the digit keys call `digit-argument` which is very\nuseful since most lispy commands accept a numeric argument.\nFor instance, \u003ckbd\u003e3c\u003c/kbd\u003e is equivalent to \u003ckbd\u003eccc\u003c/kbd\u003e (clone sexp 3 times), and\n\u003ckbd\u003e4j\u003c/kbd\u003e is equivalent to \u003ckbd\u003ejjjj\u003c/kbd\u003e (move point 4 sexps down).\n\nSome useful applications are \u003ckbd\u003e9l\u003c/kbd\u003e and \u003ckbd\u003e9h\u003c/kbd\u003e - they exit list forwards\nand backwards respectively at most 9 times which makes them\neffectively equivalent to `end-of-defun` and `beginning-of-defun`.  Or\nyou can move to the last sexp of the file with \u003ckbd\u003e999j\u003c/kbd\u003e.\n\n## How to get out of special\n\nTo get out of the special position, you can use any of the good-old\nnavigational commands such as \u003ckbd\u003eC-f\u003c/kbd\u003e or \u003ckbd\u003eC-n\u003c/kbd\u003e.\nAdditionally \u003ckbd\u003eSPC\u003c/kbd\u003e will break out of special to get around the\nsituation when you have the point between the open parens like this\n\n    (|(\n\nand want to start inserting; \u003ckbd\u003eSPC\u003c/kbd\u003e will change the code to\nthis:\n\n    (| (\n\n## List commands overview\n### Inserting pairs\n\nHere's a list of commands for inserting [pairs](http://abo-abo.github.io/lispy/#lispy-pair):\n\nkey               | command\n------------------|-------------------------------------------------------------------\n  \u003ckbd\u003e(\u003c/kbd\u003e    | [`lispy-parens`](http://abo-abo.github.io/lispy/#lispy-parens)\n  \u003ckbd\u003e{\u003c/kbd\u003e    | [`lispy-braces`](http://abo-abo.github.io/lispy/#lispy-braces)\n  \u003ckbd\u003e}\u003c/kbd\u003e    | [`lispy-brackets`](http://abo-abo.github.io/lispy/#lispy-brackets)\n  \u003ckbd\u003e\"\u003c/kbd\u003e    | [`lispy-quotes`](http://abo-abo.github.io/lispy/#lispy-quotes)\n\n### Reversible commands\n\nA lot of Lispy commands come in pairs - one reverses the other:\n\n key            | command                       | key                              | command\n----------------|-------------------------------|----------------------------------|----------------------\n \u003ckbd\u003ej\u003c/kbd\u003e   | `lispy-down`                  | \u003ckbd\u003ek\u003c/kbd\u003e                     | `lispy-up`\n \u003ckbd\u003es\u003c/kbd\u003e   | `lispy-move-down`             | \u003ckbd\u003ew\u003c/kbd\u003e                     | `lispy-move-up`\n \u003ckbd\u003e\u003e\u003c/kbd\u003e   | `lispy-slurp`                 | \u003ckbd\u003e\u003c\u003c/kbd\u003e                     | `lispy-barf`\n \u003ckbd\u003ec\u003c/kbd\u003e   | `lispy-clone`                 | \u003ckbd\u003eC-d\u003c/kbd\u003e or \u003ckbd\u003eDEL\u003c/kbd\u003e |\n \u003ckbd\u003eC\u003c/kbd\u003e   | `lispy-convolute`             | \u003ckbd\u003eC\u003c/kbd\u003e                     | reverses itself\n \u003ckbd\u003ed\u003c/kbd\u003e   | `lispy-different`             | \u003ckbd\u003ed\u003c/kbd\u003e                     | reverses itself\n \u003ckbd\u003eM-j\u003c/kbd\u003e | `lispy-split`                 | \u003ckbd\u003e+\u003c/kbd\u003e                     | `lispy-join`\n \u003ckbd\u003eO\u003c/kbd\u003e   | `lispy-oneline`               | \u003ckbd\u003eM\u003c/kbd\u003e                     | `lispy-multiline`\n \u003ckbd\u003eS\u003c/kbd\u003e   | `lispy-stringify`             | \u003ckbd\u003eC-u \"\u003c/kbd\u003e                 | `lispy-quotes`\n \u003ckbd\u003e;\u003c/kbd\u003e   | `lispy-comment`               | \u003ckbd\u003eC-u ;\u003c/kbd\u003e                 | `lispy-comment`\n \u003ckbd\u003exi\u003c/kbd\u003e  | `lispy-to-ifs`                | \u003ckbd\u003exc\u003c/kbd\u003e                    | `lispy-to-cond`\n \u003ckbd\u003ex\u003e\u003c/kbd\u003e  | `lispy-toggle-thread-last`    | \u003ckbd\u003ex\u003e\u003c/kbd\u003e                    | reverses itself\n\n### Keys that modify whitespace\n\nThese commands handle whitespace in addition to inserting the expected\nthing.\n\n key            | command\n----------------|---------------------------\n \u003ckbd\u003eSPC\u003c/kbd\u003e | `lispy-space`\n \u003ckbd\u003e:\u003c/kbd\u003e   | `lispy-colon`\n \u003ckbd\u003e^\u003c/kbd\u003e   | `lispy-hat`\n \u003ckbd\u003eC-m\u003c/kbd\u003e | `lispy-newline-and-indent`\n\n### Command chaining\n\nMost special commands will leave the point special after they're\ndone.  This allows to chain them as well as apply them\ncontinuously by holding the key.  Some useful hold-able keys are\n\u003ckbd\u003ejkf\u003c\u003ecws;\u003c/kbd\u003e.\nNot so useful, but fun is \u003ckbd\u003e/\u003c/kbd\u003e: start it from `|(` position and hold\nuntil all your Lisp code is turned into Python :).\n\n### Navigating with `avy`-related commands\n\n key            | command\n----------------|--------------------------\n \u003ckbd\u003eq\u003c/kbd\u003e   | `lispy-ace-paren`\n \u003ckbd\u003eQ\u003c/kbd\u003e   | `lispy-ace-char`\n \u003ckbd\u003ea\u003c/kbd\u003e   | `lispy-ace-symbol`\n \u003ckbd\u003eH\u003c/kbd\u003e   | `lispy-ace-symbol-replace`\n \u003ckbd\u003e-\u003c/kbd\u003e   | `lispy-ace-subword`\n\n\u003ckbd\u003eq\u003c/kbd\u003e - `lispy-ace-paren` jumps to a \"(\" character within current\ntop-level form (e.g. `defun`). It's much faster than typing in the\n`avy` binding + selecting \"(\", and there's less candidates,\nsince they're limited to the current top-level form.\n\n\u003ckbd\u003ea\u003c/kbd\u003e - `lispy-ace-symbol` will let you select which symbol to\nmark within current form. This can be followed up with e.g. eval,\ndescribe, follow, raise etc. Or you can simply \u003ckbd\u003em\u003c/kbd\u003e to\ndeactivate the mark and edit from there.\n\n\u003ckbd\u003e-\u003c/kbd\u003e - `lispy-ace-subword` is a niche command for a neat combo. Start with:\n\n    (buffer-substring-no-properties\n     (region-beginning)|)\n\nType \u003ckbd\u003ec\u003c/kbd\u003e, \u003ckbd\u003e-\u003c/kbd\u003e, \u003ckbd\u003eb\u003c/kbd\u003e and \u003ckbd\u003eC-d\u003c/kbd\u003e to get:\n\n    (buffer-substring-no-properties\n     (region-beginning)\n     (region-|))\n\nFill `end` to finish the statement.\n\n# Operating on regions\nSometimes the expression that you want to operate on isn't bounded by parens.\nIn that case you can mark it with a region and operate on that.\n\n## Ways to activate region\nWhile in special:\n- Mark a sexp with \u003ckbd\u003em\u003c/kbd\u003e - `lispy-mark-list`\n- Mark a symbol within sexp \u003ckbd\u003ea\u003c/kbd\u003e - `lispy-ace-symbol`.\n\nWhile not in special:\n- \u003ckbd\u003eC-SPC\u003c/kbd\u003e - `set-mark-command`\n- mark a symbol at point with \u003ckbd\u003eM-m\u003c/kbd\u003e - `lispy-mark-symbol`\n- mark containing expression (list or string or comment) with \u003ckbd\u003eC-M-,\u003c/kbd\u003e - `lispy-mark`\n\n## Move region around\n\nThe arrow keys \u003ckbd\u003ej\u003c/kbd\u003e/\u003ckbd\u003ek\u003c/kbd\u003e will move the region up/down within the current\nlist.  The actual code will not be changed.\n\n## Switch to the other side of the region\n\nUse \u003ckbd\u003ed\u003c/kbd\u003e - `lispy-different` to switch between different sides\nof the region. The side is important since the grow/shrink operations\napply to current side of the region.\n\n## Grow/shrink region\n\nUse a combination of:\n- \u003ckbd\u003e\u003e\u003c/kbd\u003e - `lispy-slurp` - extend by one sexp from the current side. Use digit\n  argument to extend by several sexps.\n- \u003ckbd\u003e\u003c\u003c/kbd\u003e - `lispy-barf` - shrink by one sexp from the current side. Use digit\n  argument to shrink by several sexps.\n\nThe other two arrow keys will mark the parent list of the current region:\n\n- \u003ckbd\u003eh\u003c/kbd\u003e - `lispy-left` - mark the parent list with the point on the left\n- \u003ckbd\u003el\u003c/kbd\u003e - `lispy-right` - mark the parent list with the point on the right\n\nTo do the reverse of the previous operation, i.e. to mark the first\nchild of marked list, use \u003ckbd\u003ei\u003c/kbd\u003e - `lispy-tab`.\n\n## Commands that operate on region\n- \u003ckbd\u003em\u003c/kbd\u003e - `lispy-mark-list` - deactivate region\n- \u003ckbd\u003ec\u003c/kbd\u003e - `lispy-clone` - clone region and keep it active\n- \u003ckbd\u003es\u003c/kbd\u003e - `lispy-move-down` - move region one sexp down\n- \u003ckbd\u003ew\u003c/kbd\u003e - `lispy-move-up` - move region one sexp up\n- \u003ckbd\u003eu\u003c/kbd\u003e - `lispy-undo` - deactivate region and undo\n- \u003ckbd\u003et\u003c/kbd\u003e - `lispy-teleport` - move region inside the sexp you select with `lispy-ace-paren`\n- \u003ckbd\u003eC\u003c/kbd\u003e - `lispy-convolute` - exchange the order of application of two sexps that contain region\n- \u003ckbd\u003en\u003c/kbd\u003e - `lispy-new-copy` - copy region as kill without deactivating the mark\n- \u003ckbd\u003eP\u003c/kbd\u003e - `lispy-paste` - replace region with current kill\n\n# IDE-like features\n\nThese features are specific to the Lisp dialect used.  Currently Elisp\nand Clojure (via `cider`) are supported.  There's also basic\nevaluation support for:\n\n- Scheme (via `geiser`)\n- Common lisp (via `slime` or `sly`).\n- Hy (via `comint`).\n- Python (via `comint` and `jedi`).\n- Julia (via `julia-shell`).\n\n**`lispy-describe-inline`**\n\nBound to \u003ckbd\u003eC-1\u003c/kbd\u003e. Show the doc for the current function inline.\n\n\u003ckbd\u003eC-h f\u003c/kbd\u003e is fine, but the extra buffer, and having to navigate to a symbol\nis tiresome. \u003ckbd\u003eC-1\u003c/kbd\u003e toggles on/off the inline doc for current function.\nNo extra buffer necessary:\n\n![screenshot](https://raw.github.com/abo-abo/lispy/master/images/doc-elisp.png)\n\nHere's how it looks for Clojure:\n\n![screenshot](https://raw.github.com/abo-abo/lispy/master/images/doc-clojure.png)\n\n**`lispy-arglist-inline`**\n\nBound to \u003ckbd\u003eC-2\u003c/kbd\u003e. Show arguments for current function inline.\n\n`eldoc-mode` is cool, but it shows you arguments *over there* and\nyou're writing *over here*!. No problem, \u003ckbd\u003eC-2\u003c/kbd\u003e fixes that:\n\n![screenshot](https://raw.github.com/abo-abo/lispy/master/images/arglist-elisp.png)\n\nAs you see, normal, \u0026optional and \u0026rest arguments have each a\ndifferent face. Here's how it looks for Clojure:\n\n![screenshot](https://raw.github.com/abo-abo/lispy/master/images/arglist-clojure.png)\n\n**`lispy-goto`**\n\nBound to \u003ckbd\u003eg\u003c/kbd\u003e.\n\nUse completion to select a symbol to jump to from all top-level symbols in the in current directory.\n\nWorks out of the box for Elisp, Scheme and Common Lisp.\n[clojure-semantic](https://github.com/kototama/clojure-semantic) is\nrequired for Clojure.\n\n**`lispy-eval`**\n\nThere's a feature similar to `ipython-notebook`. Evaluating an Emacs\noutline will evaluate all of the outline's code and echo the result of\nthe last expression. When an outline ends with a colon (`:`), the\nresult will instead be inserted into the buffer. If the evaluation\nresult changes for whatever reason, it will be replaced after each\nsubsequent \u003ckbd\u003ee\u003c/kbd\u003e.\n\nPython, Clojure, and Julia currently have a slightly better notebook\nsupport, pressing \u003ckbd\u003ee\u003c/kbd\u003e on the parent outline will evaluate all\nthe children outlines sequentially. This allows to arrange scripts\nhierarchically, with relatively few top-level outlines and relatively\nmany total outlines. Each outline's output can be examined by adding a\n`:` to the title of the outline.\n\nThe following example shows a buffer before and after pressing \u003ckbd\u003ee\u003c/kbd\u003e.\n\n![lispy-python-notebook.png](https://raw.githubusercontent.com/wiki/abo-abo/lispy/images/lispy-python-notebook.png)\n\nThere is one top-level outline, with one level-2 child, which in turn\nhas a four level-3 children. Three of these children end in `:`, so\ntheir output will be updated after the eval.\n\n# Demos\n\n## [Demo 1: Practice generating code](http://abo-abo.github.io/lispy/demo-1)\n## [Demo 2: The substitution model for procedure application](http://abo-abo.github.io/lispy/demo-2)\n## [Demo 3: Down the rabbit hole](http://abo-abo.github.io/lispy/demo-3)\n## [Demo 4: Project Euler p100 and Clojure](http://abo-abo.github.io/lispy/demo-4)\n## [Demo 5: -\u003e\u003eification](http://abo-abo.github.io/lispy/demo-5)\n## [Demo 6: cond-\u003eif-\u003econd](http://abo-abo.github.io/lispy/demo-6)\n\n# Screencasts\n\n- The older stuff can be found on [vimeo](http://vimeo.com/user24828177/videos).\n- The newer stuff is on https://www.youtube.com/user/abo5abo/videos.\n\n[badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg\n","funding_links":["https://liberapay.com/abo-abo","https://patreon.com/abo_abo"],"categories":["Emacs Lisp"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabo-abo%2Flispy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabo-abo%2Flispy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabo-abo%2Flispy/lists"}