5 ms·
After switching from Vim to Emacs (but keeping my hardcore modal editing muscle habits through evil-mode), I realized why most hardcore Emacs users have never f
by goldfeld 12y ago
After switching from Vim to Emacs (but keeping my hardcore modal editing muscle habits through evil-mode), I realized why most hardcore Emacs users have never felt the need for this raw composability of commands and motions (which I love): hardcore Emacs users tend to be lispers, and lispers have Paredit, and that works on such a higher level of editing that you don't need raw composability. It only works for something as homogeneous as s-expressions though.
There might as well be no concept of "words" or "lines" in a seasoned lisp programmer's mind, there's only sexps and forms. And it's so much easier to reason that way, which is not a fault of vi's grammar but arguably a fault of most programming languages' grammars. It's that fabled saying that you should rather have one data structure (sexps) with 100 operations on it than 10 structures (words, lines, bracketed expressions, paras) with 10 operations each. Vi at least makes those operations consistent across structures and thus trivially deducible.
I tend to use vi-bindings in my Emacs coding (Clojure), but I'm more and more relying on Paredit. However I'm immensely happy to have vi commands for editing prose on Emacs, and I don't think there's anything more powerful than vi for that.
- guns 12y ago> There might as well be no concept of "words" or "lines" in a seasoned lisp programmer's mind, there's only sexps and forms Forgive me for plugging my own project, but vim-sexp¹ provides exactly this abstraction as Vim text-objects, which in turn may be composed with _any_ of the operations in Vim. S-expressions as text-objects is an amazing marriage of ideas. For example, the sexp text object can be used equally as an argument to eval, yank, delete, change, select, move, and every other operator, builtin or user-defined, each optionally accepting a count. After that, the whole operation can be repeated on a new S-expression with a simple tap of the repeat command. Because Lisp forms are so regular, these actions are precise and highly reliable. ¹ http://github.com/guns/vim-sexp http://github.com/guns/vim-sexp
- deleted 12y ago[deleted]
- jacques_chester 12y ago> It's that fabled saying ... The origin of this saying is Epigrams in Programming, by Alan Perlis. http://www.cs.yale.edu/homes/perlis-alan/quotes.html http://www.cs.yale.edu/homes/perlis-alan/quotes.html
- tikhonj 12y agoActually, you can have paredit-style structured editing for whatever languages you want to support. For example, there is a pretty capable structured editing mode for Haskell[1], which has a syntax significantly less regular than s-expressions. (On the other hand, it's still more regular than most languages...) [1]: https://github.com/chrisdone/structured-haskell-mode https://github.com/chrisdone/structured-haskell-mode
- 59nadir 12y ago> There might as well be no concept of "words" or "lines" in a seasoned lisp programmer's mind, there's only sexps and forms. And it's so much easier to reason that way, which is not a fault of vi's grammar but arguably a fault of most programming languages' grammars. It's that fabled saying that you should rather have one data structure (sexps) with 100 operations on it than 10 structures (words, lines, bracketed expressions, paras) with 10 operations each. This really can't be overstated. Even if you don't really use Paredit or any kind of special tool S-expressions lend themselves to easy modification. Since a Lisp program is, by virtue of the structure, organized by default into easily separated components there is no need to think about anything else other than just expressions. When I write Racket code (in Emacs), I organize and move code in expressions instead, and if I wanted to move a certain expression I would just move to the enclosing paren and hold shift while saying "move to matching paren" and the whole expression will be marked and I can do whatever I want with it. I used to use vim before and while I did "get it" after a while I switched to Emacs when I started learning Lisp because I figured I could immerse myself in Lisp code with Emacs. The thing about it is that since I've coded almost exclusively in Lisps since then I haven't really needed what vim does best. At some point a while ago there were a slew of posts about vim and I looked at maybe getting evil-mode for emacs, but I don't know if I see the point when I almost exclusively deal with sexps.