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 (cd)))
and I want to switch it over to use a threading macro (->> dcba)
. What editing commands can I use to streamline this process?
You could do this in vanilla paredit-mode:
(a (b (c| d)))
CMt (transpose-sexps) (a (b (d| c)))
CMu (paredit-backward-up) (a (b |(dc)))
CMt (transpose-sexps) (a ((dc) |b))
CMu (paredit-backward-up) (a |((dc) b))
CMt (transpose-sexps) (((dc) b) |a)
CMp (paredit-backward-down) (((dc) b|) a)
CMp (paredit-backward-down) (((dc|) b) a)
Ms (paredit-splice-sexp) ((dc| b) a)
Ms (paredit-splice-sexp) (dc| ba)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.