visual-studio-code

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


Solution

  • 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.