35

I can't find any shortcuts for comment my code in Aptana Studio 3.0. I need shortcuts both to comment individual lines and for commenting selected blocks of code.

Some have told me to try to comment with shortcut WIN + / on my Windows OS but that does not appear workable.

TechZen
  • 64,370
  • 15
  • 118
  • 145
ValeriiVasin
  • 8,628
  • 11
  • 58
  • 78

3 Answers3

34

I was having the same problem, looks like the keyboard makes the shortcut Shift-Ctrl-/ and similar ones completely useless (for the slash character) and Aptana does not allow you to change those shortcuts.

I used Ctrl-7 and works for any type of code you are selecting, if you want to un-comment just repeat the command.

Ivan Castellanos
  • 8,041
  • 1
  • 47
  • 42
  • Wow, amazing that this question and top answers were posted a year ago, and you just now you posted your answer -- amazing because I just now had this problem and the top answers didn't work for me, but this does (if I had had this problem yesterday instead I'd be out of luck). Thank you! – Ben Lee Apr 16 '12 at 15:46
  • 2
    Thanks for the tip. This worked for ruby code. FYI its Cmd-7 on Macs yo! – mynameistechno Apr 27 '12 at 06:15
  • +1, how intuitive, should have known ctrl-7 would the obvious comment line(s) shortcut – virtualeyes Jul 26 '13 at 17:54
  • The problem is that it is not block comment, and ctrl+shift+7, at least in my Aptana 3.4.1 over PC or Mac, doesn't work. – netadictos Oct 30 '13 at 15:49
32

It depends on which language you're writing in (is this CSS, Javascript, HTML?)

For Javascript:

  • Ctrl-/ to add or remove // for a single line of code, or for multiple selected lines.

The standard Java commenting shortcuts are:

  • Ctrl-/ to add/remove // for a single line of code, or for multiple selected lines.
  • Ctrl-shift-/ to add /* */ around selected code.
  • Ctrl-shift-J to add Javadoc comments.

You can always find out shortcuts by hitting Ctrl-shift-l, which will bring up a list of all currently available shortcuts. They will change depending on if you have anything selected, what type of file you're editing, etc. Look for "Add comments", "Toggle block comments", "Toggle JS comments", and so forth.

Hulk1991
  • 3,079
  • 13
  • 31
  • 46
Rob Grant
  • 7,239
  • 4
  • 41
  • 61
  • 1
    Nice answer, but in my Aptana I only have comments for PyDev... Any shortcuts for comments don't exists :( I have downloaded Aptana from official site - why my IDE hasn't this shortcuts? – ValeriiVasin May 13 '11 at 05:21
  • Have you installed PyDev as a separate plugin? Are you writing PHP files or HTML, or something else? – Rob Grant May 20 '11 at 06:21
  • Yes, PyDev is installed. I don't know how - as separate or something else... – ValeriiVasin Jun 28 '11 at 20:32
  • For what it's worth, while CTRL-SHIFT-L brings up a list of shortcuts commenting out shortcuts aren't listed (CTRL-SHIFT-/ and CTRL-/). At least, not for PHP. – Logos Dec 14 '12 at 23:40
  • For anyone asking themselves why command+7 does not work on mac go to preferences->general->keys and select "toggle js comments" and make sure that "Javascript editor scope" is selected!!! This fixed the problem for me. – eclipse Jun 11 '14 at 09:00
10

Check Commands > Source > Comments. A number of shortcuts are listed there.

Ingo Muschenetz
  • 3,352
  • 1
  • 19
  • 19