marknt15
marknt15

Reputation: 5127

Netbeans macro command for /* */ comment block

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.

Upvotes: 8

Views: 8745

Answers (4)

roybatty
roybatty

Reputation: 127

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)

Upvotes: 3

lanrat
lanrat

Reputation: 4694

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

Upvotes: -1

Akshay Jindal
Akshay Jindal

Reputation: 385

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 ""

Upvotes: 1

mseancole
mseancole

Reputation: 1672

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

Upvotes: 3

Related Questions