How do you comment a form in cursive?
Thanks!
Comment out that is
#_
This applies to all of clojure, not only cursive though
So I might have misunderstood your question
Ah, so there is no comment form like in emacs.
There isn't an intellij action for it, no
There's an open issue however https://github.com/cursive-ide/cursive/issues/1047
Good to know!
I mean, the block comment action works. It just prefixes all the lines which isn't always nice. Parinfer does the right thing though
Hmm. block comment action is disabled for me no matter whether I'm in paredit or infer
That's strange... I'm using it on a regular basis
Via the keyboard shortcut anyway
do you have anything selected when you invoke it?
well yeah… I don’t see how else you’d use it
pushing ⌘/
I use comment
. It’s not specific to cursive but works very well. https://clojuredocs.org/clojure.core/comment
You can record an IntelliJ macro (nothing to do with Clojure macros) https://stackoverflow.com/questions/9638895/rubymine-shortcut-to-insert/9639266#9639266
Thanks for the explanation. Although I believe that still triggers the line comment action
(before 1. make sure you’re actually inside an Sexprs)
1. Edit
| `Macros` | `Start Macro Recording`
2. Navigate
| Structural Movement
| Move backward out of Sexpr
3. Type #_ whenever the cursor is (should be at the beginning of an Sexprs)
4. Edit
| `Macros` | `Stop Macro Recording`
5. Give your “macro” a name
6. Go to Keymap and assign a keyboard shortcut for it
Just tried it, it works! It’s a nice idea.
You can be anywhere inside an Sexprs, press your shortcut, and comments out the whole form via #_
You can add “Format Code” as a last action of your macro, then it looks even better 🙂