Sublime Forum

CSS classes choose

#1

Hey,
I’m using sublime for over 4 years.
Last month I update the version to the last version, and the css choosen classes was changed.
I want to know how can I edit that.

When I got a class, for example “.hero-content-text” and I’m trying to delete the last word, or select the last word (“text”) - I click “CTRL+BACKSPACE” or “CTRL+SHIFT+LEFT ARROW” - but instead of delete/choose the “text” word - it is deleting or selecting the whole class “hero-content-text”

Please let me know how can I fix it - it waste of time for me…
Thanks!

0 Likes

#2

That is because in ST, there is a setting called word_seperators that defines a group of characters that is used to break up words.

In case of CSS, in syntax specific setting, the - is removed from the word separator group by default.

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

So, to solve this, after you open a css file (any css file), just go to Preferences -> Settings - Syntax Specific which will open the syntax specific setting for CSS. In the right hand pane, just put the following in that (we just add the - (dash), that’s all, so that dash separated words are considered individual words rather than the whole thing being considered as a single word).

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

Now if you try to ctrl + backspace for example .hero-content-text, it should just delete text and not the entire .hero-content-text.

0 Likes