0

Let's say I have this:

(defn -main [& args]
  (my-func|tion 5) (my-function-2 "hello")
  (third-function-of-mine nil))

where | is my cursor.

And I want to delete (my-function 5).

So in the end I will have this:

(defn -main [& args]
   | (my-function-2 "hello")
  (third-function-of-mine nil))

So basically I need to kill the whole function including the parentheses.

How to do that in Spacemacs or Emacs? I am using evil mode, but even if you are using the standard shortcuts any help is appreciated.

3
  • In this case, you can just delete the paren text object. Assuming standard keybindings, it would be da(. Commented Jul 13, 2022 at 15:18
  • C-M-u C-M-n C-w should do it with vanilla emacs. For the first two keybindings, see Moving in the Parenthesis Structure (or, better, read it in Emacs itself: C-h i g(emacs)RET i paren TAB should take you to the same section of the manual). The third, C-w, is the standard kill-region command. Commented Jul 13, 2022 at 15:39
  • [ m w if lispy is active ;-) Commented Jul 13, 2022 at 16:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.