Visual Studio Code configure word break for text editor navigation

Viewed 51

We tend to use kebab case for our naming in our FE app, but the ctrl arrow key navigation considers a dash a word break. Is there anyway to configure vscode so that ctrl + right/left behaves the same for both FooBar and foo-bar, i.e. considers both an entire word.

1 Answers

vscode has native support for altering word breaks using the editor.wordSeparators setting.

Characters that will be used as word separators when doing word related navigations or operations

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

You can simply remove the -:

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

Note: If you are using cursorWordPartRight keybind to navigate words partially, this setting will overrule it, meaning, you won't be able to step through the word partially (at that character), as the name implies.

Related