I move my s-expressions back and forth
30 Nov 2015Some people find lispy too weird and/or complex to try, quite possibly because of it's sort-of-modal key binding structure. Which is a shame, since out of 7k lines of lispy's code, only 500 lines do key bindings, the rest do all sorts of useful stuff, like sexp navigation/modification, outlines and REPL interaction.
In this post, I'll show a short example of using lispy's functions
outside of lispy-mode
, and compare it with the default approach.
Moving s-expressions while the point is anywhere
Using this simple hydra, and the key sequence C-c m sss www I got the following GIF:
Doing the same lispy-way
To do it the lispy-way, I move the point before the list that I wish to operate on (with [ key), and press sss www to get the following GIF:
The difference here is that no hydra is necessary in the second case,
the key bindings come only from lispy-mode
. But the first case will
also work if lispy-mode
is off.
Which way is better?
I think the second way is better, since it's faster and more clear, but you can decide for yourself. By the way, you can also move symbols, comments and sub-words (if that makes sense) with w and s, provided you mark them with a region first.