3

I often need to swap s-expressions. How can I do that with paredit? I want to do things like the following:

(list |1 0)
(list 0 |1)

or:

(list 1 |0)
(list |0 1)
Antoine
  • 133
  • 3
  • 5
    Emacs has a command for that by default, it's bound to `C-M-t`. –  Sep 02 '18 at 15:14
  • 1
    What @DoMiNeLa10 said. At least for the two simple examples you show, I see no need for paredit. Just put your cursor between two sexps and transpose them. (And use `C-M-f` or `C-M-b` to move forward/backward over sexps.) But different people use Emacs differently. – Drew Sep 02 '18 at 22:49
  • Thanks to both of you it works perfectly. Feel free to post an answer, so that I can select it. :) – Antoine Sep 03 '18 at 13:38

1 Answers1

3

Emacs comes with such command out of the box, transpose-sexps. It's bound to C-M-t by default.