I am using the latest version of Visual Studio Code and I am using the PHP programming language. I am selecting a variable but it only selects the variable name, not the $ symbol.
By default it selects like this:
But I want it like this:
Is there any setting that enables this behavior?
Any information on this would be greatly appreciated. Thanks!
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.
Press F2 and then type the new desired name and press Enter. All usages of the symbol will be renamed, across files.
You can download Quick and Simple Text Selection, the use ctrl+k " shortcut. Show activity on this post. There is actually another way to expand selection which is called expand_region and undo_expand_region . Their default keybindings are ctrl+w / shift+ctrl+w .
The best way is to edit the VsCode settings.json and specify it for the PHP language. You can open it typing VsCode command:
Preferences: open settings (JSON)
And specify inside the "editor.wordSeparators" setting for your language removing the '$' symbol:
"[php]": { "editor.wordSeparators": "`~!@#%^&*()-=+[{]}\\|;:'\",.<>/?" }
You need to remove the $
symbol from the editor.wordSeparators
directive. This is the default value:
// Characters that will be used as word separators when doing word related navigations or operations. "editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?",
You can make this language specific if you want, so it only applies to PHP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With