Reputation: 261
I'm a fan of sub-word captures, but I'm used to the sublime way where if you have a word with underscores, it will exclude the underscore from the capture like this:
In VScode, I setup my keyboard shortcuts to use the cursorWordPartLeftSelect
and cursorWordPartRightSelect
, but they include the underscore like this:
Here are the lines from my config:
Is there a way to change that?
Upvotes: 9
Views: 1475
Reputation: 141
I'm experimenting with this extension, and removing underscores and hyphens from VS Code's word separators: https://github.com/mlewand/vscode-select-part-of-word
Haven't had the time to dig into it and configure it to match Sublime Text yet but I'm praying this will be a part of the puzzle in getting VS Code to work like Sublime Text did!
Upvotes: 0
Reputation: 181639
Add the underscore character to the Editor: Word Separators
list in the settings (just search for separators
).
~!@#$%^&*()-=+[{]}\|;:'",.<>/?_
// with the underscore added at the end
I am a little surprised it isn't already there but it isn't. Then your WordPart
selectors won't include the underscores.
It looks like v1.44 adds a fix to this so that the cursorwordpart
left/right acts like Sublime Text with respect to underscores. See https://github.com/microsoft/vscode/issues/93239.
Upvotes: 11