Adding mult line comment cmd-shift-/


#1

Is there a community managed keymap file somewhere with bindings you’d expect like ‘cmd-shift-/’

I just want to get my multi-line comment mapped to those keys. It seems like a mapping that should be available by default but it’s not.

Same goes for ‘cmd-shift-up’. I would like to highlight lines this way as sublime does.

Thanks


#3

For those of us that haven’t used Sublime Text in months … what exactly are you expecting these keymappings to do?


#4

In sublime, ‘cmd-shift-/’ adds a multi-line comment to your selection like so: /* */

In Atom, ‘cmd-/’ is mapped to toggle-line-comments in the Core settings. Just need to figure out how to do the multi-line comment and I’ll be set. Is that already mapped in Core settings? If so I’m not seeing it.

Forget the highlight one. That’s my bad. I was too eager to add that to my topic. I was actually looking for select-up and select-down mapped like so:

'body':
  'alt-shift-up': 'core:select-up'
  'alt-shift-down': 'core:select-down'

which I was able to figure.


#5

I’m not sure there is currently support for multi-line commenting in the API. There is a function for single line commenting:

But I haven’t found one for multi-line commenting. Though I could be missing something.


Things I disliked in atom
#6

Well thanks for the response. Yea I found the single line comment too.


#7

Is there a plan on having this feature? Seems pretty basic feature to me and still don’t see it on 1.0.


#8

I don’t know of any plans, no. But anyone is welcome to create a package or submit a PR. I wouldn’t be surprised if there was already a package for it.


#10

There is a way:

command + return; (OSX)


#11

I don’t see how Cmd+Enter would perform a multi-line comment:

In Atom’s default configuration, Cmd+Enter performs editor:newline-below. Perhaps you have a package installed that is adding that feature?


#12

Highlight what you want to comment out and then hit command + return. I don’t know if there is a diff between being on a Mac and something else, but I am on a Mac. It works for me. There are also Atom plugins for commenting if you want more options and to get fancier. Like the ability to uncomment.


#13

What @leedohm is saying is that this feature is not in the core set of Atom functionality. You are able to do it because you have a package installed or a keybind set that adds that ability. You can find out where it’s coming from by going to Settings -> Keybindings and searching for cmd-enter just as in the picture above.


#14

Bump. Waiting for this. Anyone found to do this?


#15

I remember playing around with this some time ago. I guess I could provide some guidance if someone wants to make a PR.