shaunlebron / history-of-lisp-parens

a history of Lisp's most notorious artifact, parentheses
570 stars 29 forks source link

Vim lisp plugins #11

Open Deraen opened 7 years ago

Deraen commented 7 years ago

Paredit.vim is probably quite similar to paredit.el

My favorite is https://github.com/guns/vim-sexp + https://github.com/tpope/vim-sexp-mappings-for-regular-people which is probably inspired by paredit and others. But unlike paredit, it doesn't prevent writing unbalanced code, or doesn't modify existing Vim operations, but instead provides collection of Vim text objects, movements and operations, to work with elements, forms and parentheses, that can be composed together with each other and other Vim operations.

For example:

ysae( will add parentheses around current element. ys is a command from separate vim-surround (non lisp specific) plugin that will surround given text object in given pair of "surroundings" (e.g. parenthesis). ae is text object for "around element" from vim-sexp.

daF (delete around Form) removes current top-level form (delete is Vim built-in op), diF (delete inside Form) removes contents of current top-level fom (leaves the parenthesis), and same logic holds for ae, ie, af and ie (around/inside, element/form), and these can obviously be used with other commands like y (yank, copy), c (change) etc.

TL;DR; Vim-sexp enables "Vim native" operations on Lisp code.

shaunlebron commented 7 years ago

Thanks for not just linking the projects, but for giving a contextual summary of why it's noteworthy. 💯

I added it to the timeline, but I'll leave this open since I am feeling compelled now to give a short summary of the benefits of each contemporary tool, like the one you gave here.