9

I wish to create macro in Netbeans to put block comment over function. I have preference of code formatting over file save. So When I close file it saves code automatically and format it.

Issue is when I create function and comment it. It unformatted my whole block of code like this.

/**
 *function abc(){
 *var a, b = 50;
 *}
 */

I wish to create comment like this. so it keep my coding properly formatted as well.

 /*
 |
 | function abc(){
 |     var a, b = 50;
 | }
 |
 */ 
Sankalp
  • 1,300
  • 5
  • 28
  • 52

2 Answers2

1

You can add your own macro by Following this instructions:

  1. Edit->Start Macro Recording
  2. Edit->Stop Macro Recirding
  3. It Will pop-up one Box For Editor Macros->Add Your Choice of Macro Name
  4. In code area add Your custom comment code in " your code "; Like,

Blockquote "/* | | function abc(){ | var a, b = 50; | } | */"

  1. Assign a Short Cut Key to your Custom Macro.

That's It

Chintan7027
  • 7,115
  • 8
  • 36
  • 50
0

Though I couldn't find macro for the same. But I found alternative. Use Ctrl+Shift+R toggle, for multiple line action at same time & add pipeline sign. But it take extra effort for starting and ending comment.

Sankalp
  • 1,300
  • 5
  • 28
  • 52