1

I downloaded the Textmate bundle for haml in Sublime Text 2 and did this (changing comment from / to correct -#):

http://www.sublimetext.com/forum/viewtopic.php?f=4&t=3995

Well, now Ctrl+/ will always give -# which is good. But I also want another shortcut key for / such as Ctrl-#. How do I do that in Sublime Text 2? Basically I want shortcut key for both / and -# for comment.

Thanks all!!

HP.
  • 19,226
  • 53
  • 154
  • 253
  • You could add the second comment style as the block comment style. However, the problem with this is you have to highlight the whole line to comment/uncomment it, also you have to have comment text at the end for it to work properly in Sublime. Another possibility is to copy "comment.py" and edit it to use the different comment style, then add a key binding for your custom plugin. I did not have much success doing this so I did not add it as an answer. – d_rail Mar 12 '13 at 21:50

1 Answers1

0

I haven't done this much myself, but I believe you'll want to edit the appropriate keymap file to create a new shortcut.

Sublime has some documentation on this here: http://sublimetext.info/docs/en/reference/key_bindings.html

  • Problem is: there isn't a way to add new command http://docs.sublimetext.info/en/latest/reference/commands.html – HP. Mar 14 '13 at 01:57