Giter VIP home page Giter VIP logo

strict-paredit-vscode's Introduction

Strict Paredit

Classic, Emacs Paredit-like Structural editing and navigation for Common Lisp, Clojure and Scheme.

This is a Paredit extension for Visual Studio Code. It is a thin wrapper around paredit.js. You find it inside Code's extension view and on the Marketplace.

Commands

Note: You can choose to disable all default key bindings by configuring paredit.defaultKeyMap to none. (Then you probably also want to register your own shortcuts for the commands you often use. see ets/keys.json for example). By default the strict mode map is used. Below commands work in both strict mode and original mode. If you are new to Paredit, below shortcut in bond text is a small but very frequently used set of commands that helps in 95% of the time. I hightly recommend you memorize them to be efficient.

Navigation

Default keybinding Action
ctrl+right Forward Sexp
ctrl+left Backward Sexp
ctrl+down Forward Down Sexp
ctrl+up Backward Up Sexp
ctrl+alt+right Close List

Selecting

Default keybinding Action
ctrl+w Expand Selection
ctrl+shift+w Shrink Selection
ctrl+alt+w Select Current Top Level Form

Editing

Default keybinding Action
ctrl+alt+. Slurp Forward
ctrl+alt+< Slurp Backward
ctrl+alt+, Barf Forward
ctrl+alt+> Barf Backward
ctrl+alt+s Splice
ctrl+alt+shift+s Split Sexp
ctrl+delete Kill Sexp Forward
ctrl+shift+backspace (on Mac) Kill Sexp Forward
ctrl+backspace Kill Sexp Backward
ctrl+alt+down Splice & Kill Forward
ctrl+alt+up Splice & Kill Backward
ctrl+alt+9, Ctrl+alt+( Wrap Around ()
ctrl+alt+[ Wrap Around []
ctrl+alt+{ Wrap Around {}
ctrl+alt+i Indent
ctrl+alt+t Transpose

You can also select the sexp with ctrl+w then wrap around by typing (, [ or { and delete it with backsapce

Strict only keybinding

Strict mode keybinding Action
backspace Delete Backward or move left if at )]}
delete Delete Forward or move right if at )]}
shift+backspace (on Mac) Delete Forward or move right if at )]}
ctrl+alt+backspace Force Delete Backward
ctrl+alt+delete Force Delete Forward
alt+shift+backspace (on Mac) Force Delete Forward

NB: Strict mode is enabled by default. The backspace and delete keys won't let you remove parentheses or brackets so they become unbalanced. To force a delete anyway, use the supplied commands for that. Strict mode can be switched on/off by configuring paredit.defaultKeyMap to strict/original.

Copying/Yanking

Default keybinding Action
ctrl+alt+c ctrl+right Copy Forward Sexp
ctrl+alt+c ctrl+left Copy Backward Sexp
ctrl+alt+c ctrl+down Copy Forward Down Sexp
ctrl+alt+c ctrl+up Copy Backward Up Sexp
ctrl+alt+c ctrl+alt+right Copy Close List

Cutting

Default keybinding Action
ctrl+alt+x ctrl+right Cut Forward Sexp
ctrl+alt+x ctrl+left Cut Backward Sexp
ctrl+alt+x ctrl+down Cut Forward Down Sexp
ctrl+alt+x ctrl+up Cut Backward Up Sexp
ctrl+alt+x ctrl+alt+right Cut Close List

Maintainers

This project is forked from https://github.com/BetterThanTomorrow/calva-paredit. Original one is maintained by author Peter Strömberg as part of project calva, https://github.com/BetterThanTomorrow/calva

I maintain this fork with the following stress:

  • Tweak to keep the joy of original Emacs paredit, especially how delete, back parens and navigation works.
  • Make it useful for Common Lisp and Scheme developers (Assume there's no one use vscode to code Emacs Lisp :)

strict-paredit-vscode's People

Contributors

ailisp avatar anticrisis avatar avfonarev avatar dentrado avatar gclapperton avatar martinholloway1970 avatar pez avatar yogthos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.