Skip to content
A LEM mode to make Lisp code editing more efficient!
Common Lisp
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
ChangeLog.rst Initial implementation of the most usable functionality. Jan 12, 2020
README.rst Another fix. Jan 13, 2020
TODO.org Added support for selection of the current symbol with Alt-m. Jan 13, 2020
lem-pareto-mode.lisp
lem-pareto.asd Added support for selection of the current symbol with Alt-m. Jan 13, 2020

README.rst

Pareto - LEM mode to make Lisp code editing more efficient!

Pareto is an additional minor mode, supplement to the Paredit, built into the LEM.

The main idea was taken from Lispy mode for Emacs. Whereas Lispy is a separate mode, Pareto reuses some Paredit functionality, and both minor modes should be enabled.

The idea

The idea, inherited from the Lispy is to use short one letter (vi style) binding to navigate and edit sexps. Most bindings manipulate with the "current sexp". Current sexp is a sexp right before the cursor or right after the cursor.

Pareto implements only most commonly used functionality of the Lispy:

  • m - marks the current sexp.
  • c - copies current sexp.
  • Ctrl-k - kills current sexp and moves point to the next one.
  • r - raises current sexp.
  • R - raises current sexp and all following siblings.
  • < - moves right paren to the left (aka barf).
  • > - moves right paren to the right (aka slurp).
  • j - jumps to the next sibling sexp.
  • k - jumps to the previous sibling sexp.
  • Return - autoindents a new line (this is not from Lispy, but also nice to have feature).
  • ( - does the same like Paredit, but additionally can surround selected region.

Pareto tries to keep implementation simple and readable by reusing as many code as possible and providing excessive comments.

Installation

  1. Clone the repository https://github.com/40ants/lem-pareto to some directory:

    mkdir -p ~/projects/lisp/
    cd ~/projects/lisp/
    git clone https://github.com/40ants/lem-pareto
  2. Add this initialization code to your ~/.lem/init.lisp:

    (in-package :lem-user)
    
    (push "~/projects/lisp/lem-pareto/" asdf:*central-registry*)
    (asdf:load-system :lem-pareto)
    ;; Enable Paredit and Pareto along with Lisp mode
    (add-hook *find-file-hook*
              (lambda (buffer)
                (when (eq (buffer-major-mode buffer)
                          'lem-lisp-mode:lisp-mode)
                  (change-buffer-mode buffer 'lem-paredit-mode:paredit-mode t)
                  (change-buffer-mode buffer 'lem-pareto-mode:pareto-mode t))))
You can’t perform that action at this time.