Reputation: 7223
I've been using emacs/evil/cider for a while and finally want to make the plunge into a paredit like environment. I'm trying evil-cleverparens, though imagine this concept applies to any sexp-editor/mode.
Say I have a nested sexp (a (b (c d)))
and I want to switch it over to use a threading macro (->> d c b a)
. What editing commands can I use to streamline this process?
Upvotes: 0
Views: 64
Reputation: 106
You could do this in vanilla paredit-mode:
(a (b (c| d)))
C-M-t (transpose-sexps)
(a (b (d| c)))
C-M-u (paredit-backward-up)
(a (b |(d c)))
C-M-t (transpose-sexps)
(a ((d c) |b))
C-M-u (paredit-backward-up)
(a |((d c) b))
C-M-t (transpose-sexps)
(((d c) b) |a)
C-M-p (paredit-backward-down)
(((d c) b|) a)
C-M-p (paredit-backward-down)
(((d c|) b) a)
M-s (paredit-splice-sexp)
((d c| b) a)
M-s (paredit-splice-sexp)
(d c| b a)
Upvotes: 1