Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Neatbeans: Editing PHP and double clicking a variable name

I have recently made the switch from Dreamweaver (10+ years) to Netbeans and am loving it. The only issue I'm having is I'm use to being able to double click a PHP variable name and the code editor auto selecting the variable name but NOT including the leading $.

So if you double click $variableName only variableName gets highlighted. In NetBeans if you double click $variableName , you automatically select the entire variable name and the $.

I understand it's a small issue, but I double click variable names and drop them into bindParams about a hundred times a day and it's driving me nuts to have to always remove the $ after pasting.

Using Netbeans 7.4

like image 588
Ryan Avatar asked Feb 08 '14 21:02

Ryan


1 Answers

Sounds rather like a macro for repetitive task. If you have $categoryName in your clipboard, you can turn

$data->bindParam(|); // | is where cursor is

into

$data->bindParam(':categoryName', $categoryName);

with this simple macro: (tools->options->Editor->macros tab->new, name it, paste code, set shourtcut)

"':" paste-from-clipboard caret-forward ", " paste-from-clipboard match-brace caret-forward caret-forward delete-next caret-end-line
like image 83
dev-null-dweller Avatar answered Oct 24 '22 23:10

dev-null-dweller