Is there a way to copy/yank a whole a form in Slime/Emacs?
For instance, if I have the following function:
(myfunc (lst)
(myotherfunc lst))
I'd like to yank/copy:
(myotherfunc lst)
by issuing a keyboard shortcut when my cursor is at the opening or closing parenthesis for that form (at the point where Slime/Emacs does parenthesis matching).
C-M-SPC (mark-sexp) to put the mark at the end of the sexp, then copy/yank
C-M-f (forward-sexp) and C-M-b (backward-sexp) are useful to move forward and backward over a balanced expression
http://www.emacswiki.org/emacs/ParenthesisMatching#toc2
In my Emacs, function kill-sexp
is bound to C-M-k. That is, assuming the point is just before an opening delimiter of a balanced expression, press Control, Meta, and k at the same time.
This same command works in various other non-Lisp modes, such as killing brace-delimited blocks in a C-style mode, though the kill-sexp
command may not be bound to the same keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With