16 comments

[ 3.0 ms ] story [ 53.8 ms ] thread
I'm learning structural editing at work at the moment, the most useful ones for me so far have been:

- slurp forward

- raise

Congratulations, you came up with a programming verb that’s even more disgusting than “squelch”.
Came up with? Slurp/Barf are _at least_ ~35 years old. Possibly more?
That doesn't make those terms any less disgusting to use.
Squelch is a disgusting verb? Is this one of those "I can't stand the word moist" things?
vim-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-peopl...

Thanks, 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

Try 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.
Also 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.
For Lisps I prefer parinfer. It just works, no need to learn any new shortcuts.
I'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...
cannot do clojure without paredit, which is all finger memory now
Any good pre-made keybinding options for VS Code Vim?