2

All:

I am pretty new to sublime( I am using ST2), I wonder if there is a plugin or shortcut that allow me to select text and add a formatted block comment like:

/**
 * This is the comment.
 *
 */

I only know add multiLine comment with CTRL+/, but for above, I really have no idea, any help?

Thanks

Kuan
  • 11,149
  • 23
  • 93
  • 201
  • Before you get too used to ST2, I would **strongly** suggest you upgrade to [ST3](http://sublimetext.com/3). The last bugfix release of ST2 was nearly 3 years ago, while the latest development build of ST3 was released 2 days ago. ST3 has a *huge* amount of new features, improvements, and fixes over ST2. Don't worry about the "beta" label, I've been using ST3 exclusively for over 3 years now - it's definitely production-quality. Additionally, many plugins now only work with ST3, or ST2 support is no longer ongoing. – MattDMo Apr 15 '16 at 19:07

2 Answers2

4

It sounds like you are looking for the package DocBlockr.

Once you install this on Sublime, simply type /** above the method and the entire comment stub will be generated for you, including parameters and return type! See example below.

You can find instructions on how to install DocBlockr in the Github README linked above.

Example image

Enteleform
  • 3,753
  • 1
  • 15
  • 30
Adela Chang
  • 131
  • 2
0

for normal block comments the answer is here

Shortcut to comment out a block of code with sublime text

Windows: Ctrl+Shift+/

Mac: Command ⌘+Option/Alt+/

Community
  • 1
  • 1
Master Fathi
  • 349
  • 1
  • 9
  • 19
  • Thanks, but that waycan only add /* and */ at the ends of selected text, I want a way to look exactly like the format in my question – Kuan Apr 15 '16 at 16:12
  • oh i see, i have no idea for that, i will edit my answer maybe it could be of some help to another person. – Master Fathi Apr 15 '16 at 16:16
  • Thanks, **Adela Chang** helps find out a plugin called DocBlockr. – Kuan Apr 15 '16 at 16:24