4 ms·
Paredit mnemonics for slurping and barfing Lisp symbolic expressions
- draven 5y agoSee also: the animated guide to paredit: http://danmidwood.com/content/2014/11/21/animated-paredit.html http://danmidwood.com/content/2014/11/21/animated-paredit.ht... for an animated presentation of those commands, plus a few more.
- slifin 5y agoI'm learning structural editing at work at the moment, the most useful ones for me so far have been: - slurp forward - raise
- thewakalix 5y agoCongratulations, you came up with a programming verb that’s even more disgusting than “squelch”.
- casion 5y agoCame up with? Slurp/Barf are _at least_ ~35 years old. Possibly more?
- charcircuit 5y agoThat doesn't make those terms any less disgusting to use.
- shakna 5y agoSquelch is a disgusting verb? Is this one of those "I can't stand the word moist" things?
- Snarwin 5y agovim-sexp-mappings-for-regular-people [1] uses really easy-to-remember shortcuts for these: - "backward slurp" is "<(" (move opening paren to the left) - "forward slurp" is ">)" (move closing paren to the right) - "forward barf" is "<)" (move closing paren to the left) - "backward barf" is ">(" (move opening paren to the right) [1]: https://github.com/tpope/vim-sexp-mappings-for-regular-people https://github.com/tpope/vim-sexp-mappings-for-regular-peopl...
- agumonkey 5y agonext: paredit-convolute-sexp
- clircle 5y agoThanks, I will give paredit a shot. I'm a regular emacs user, but I normally use expand-region[1] and cut/paste to edit lisp code. Expand-region usually knows what I want to move around after just one or two calls, only requires one key binding, and has visual feedback. And it works great in every language I have used. [1] https://github.com/magnars/expand-region.el https://github.com/magnars/expand-region.el
- volforix 5y agoTry smartparens. It's a successor to paredit and works for other languages as well. I have never coded (and navigated code) faster than in Clojure on Emacs w/ smartparens.
- Jim_Heckler 5y agoAlso try Lispy (only for lisps). Works just like SP and Paredit except most commands require a single unmodified key press, but can only be used when point precedes or follows a delimiter or text is selected. Feels like magic.
- tut-urut-utut 5y agoFor Lisps I prefer parinfer. It just works, no need to learn any new shortcuts.
- servytor 5y agoI'm racking my brains, but in the #lisp channel I read a discussion about dealing with parentheses before paredit, and it was really interesting. I entirely forget the key-chords that were mentioned though...
- db48x 5y agohttps://emacsrocks.com/e14.html https://emacsrocks.com/e14.html
- redsid 5y agocannot do clojure without paredit, which is all finger memory now
- melony 5y agoAny good pre-made keybinding options for VS Code Vim?