Home » Php » php – Netbeans macro command for /* */ comment block

php – Netbeans macro command for /* */ comment block

Posted by: admin July 12, 2020 Leave a comment

Questions:

I am using Netbeans 6.8 and trying to create a custom PHP comment code block macro with the /* */ style and not the usual double slash.

So far with googling and asking in PHPUGPH, I got this macro code (tools->options->editor->macros):

copy-to-clipboard delete-previous "/*" paste-from-clipboard "*/" 

You must first highlight the code and press the shortcut key combination to make a comment block.

My problem now is I don’t know the macro code to uncomment a PHP block.
I found some code but I can’t make it work.

How to&Answers:

I know this is old (a little over a year), but I found this while looking for useful macros for netbeans and noticed it was still unanswered. I’ve figured out a solution if you’re still interested. I know I’ll be using it from now on, thanks for the idea 🙂

selection-forward
selection-forward
copy-to-clipboard
remove-line
paste-from-clipboard
delete-previous
delete-previous
insert-break

Edit: BTW, I’m using 7.0.1, but I believe this should still work in 6.8

Answer:

this macro worked for me (similar to dreamweaver php block comment).

added to options > editor > macros

cut-to-clipboard "<?php /*" paste-from-clipboard "*/ ?>" 

i set the keyboard shortcut to shift+option+cmd+c (mac)

Answer:

Here is one of the simple solution for doing this

Just create your macro and then put this code in macro

copy-to-clipboard
” ” paste-from-clipboard “”

Answer:

I’m not sure about macros, but I know Netbeans has a really useful comment and uncomment buttons for a block of code. Simply highlight all the code you want to comment or uncomment and click one of the 2 buttons. (one button for commenting, the other for uncommenting)

enter image description here