Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode - Is there a way to customise double-click select behaviour?

Specifically for php, traditionally in other editors (such as np++) when you double click on a variable name, for example, it would select just the name without the '$'. In VSCode it selects the variable name plus the '$' and often also a tailing '-' if there is one.

Take

$foo->bar(); 

Current Behavior:

double clicking 'foo' selects:

$foo- 

Desired Behavior:

double clicking 'foo' selects:

foo 

Edit: Here's the github issue: https://github.com/Microsoft/vscode/issues/2036

like image 508
Dylan James McGannon Avatar asked Jan 14 '16 03:01

Dylan James McGannon


People also ask

What does Ctrl d do in VS Code?

Ctrl+D selects the word at the cursor, or the next occurrence of the current selection. Tip: You can also add more cursors with Ctrl+Shift+L, which will add a selection at each occurrence of the current selected text.


1 Answers

Since this issue has been resolved it's worth adding this answer.

You can now accomplish this in your settings by modifiying the "editor.wordSeparators" setting.

Here is the default:

"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?" 

To allow the selection of $foo you can remove the $ from the above string.

like image 161
Douglas Gaskell Avatar answered Nov 03 '22 23:11

Douglas Gaskell