Sublime Forum

Word separators and CamelCase

#1

Hi,

Is it possible to modify the word separators preference:

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

Such that it correctly selects individual words inside CamelCase?

For example, if you have FooBarSmang and you double click the first ‘a’ Sublime would select ‘Bar’ (currently it would select the whole word). Adding capital letters one after the other doesn’t work, because then it won’t select the actual capital (in case it would select ‘ar’ instead of ‘Bar’).

0 Likes

#2

It is not possible to do this simply with ‘word_separators’, but it would be possible with a bit of Python…

In the meantime, you can click just before Bar (Foo|BarSmang) and press Alt-Shift-Right to select Bar.

Or press Ctrl-Left to jump to the beginning of the term, press Alt-Right to jump between the words, and Alt-Shift-Right to select the word (or words :smile: ) you want to select.

Andy.

1 Like