Commenting Macro


Hey Guys,

I just started using Atom, i am trying to make a macro,

if text is marked and i hit the shortcut(i have chosen) then the text will be surrounded by

/* Marked text */

And if it all are still marked and i hit the shortcut again, then it removes the comment marks.

Of course if nothing is marked, then /* ‘cursor here’ */ would be put in instead.

So in essence a commenting on/off button is what i am trying to make.

Hope someone can help :slight_smile:


That already exists. In the Edit dropdown menu, look for Toggle Comments.


Thank you for the answer, sometimes the answer is right in front of you nose :slight_smile: Follow up question, how do i change the shortcut for it, the one that is assigned from standard does not seem to work…


The documentation covers that. You can inspect keybindings using the Keybinding Resolver package.