If I have a variable called helloWorld, and I put my cursor somewhere in World, and run editor.action.smartSelect.grow, it'll just select "World". Is there a setting to make it select the entire variable, helloWorld? I want it to behave more like IntelliJ.
Just disable the following setting: "Editor > Smart Select: Select Subwords".
You can achieve that by one of the following commands.
editor.action.smartSelect.expand
editor.action.smartSelect.grow (obsolete)
[edit: Obsolete, vscode has camelCase navigation/smartSelection since v1.25]
An important prerequisite is to have the feature of camel case navigation enabled. For some inexplicable reason, VS Code doesn't come with it by default and requires one to install an extension for it.
My suggestion for camelizaton is Camel Case Navigation from Maptz, which can be installed from the GUI or by the command below. Try out your camel humping by ctrl+left and ctrl+right to verify the functionality.
code --install-extension maptz.camelcasenavigation
I've mapped the expansion and shrinkage in my settings.json the following way.
{ "key": "ctrl+alt+right",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus" },
{ "key": "ctrl+alt+left",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus" }, ...
I've been told on occasion that some people experienced that functionality to be distorted, though. Unable to confirm that, we speculated that it was due to an unfortunate combination of expansions and plugins, possibly colliding somehow. May that be the case in your editor?
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