Ryan
Ryan

Reputation: 804

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

Upvotes: 6

Views: 484

Answers (1)

dev-null-dweller
dev-null-dweller

Reputation: 29492

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

Upvotes: 1

Related Questions