Sublime Forum

auto_complete_triggers

#1

I am curious about this setting & would like to know what could possibly added or removed to improve my experience with Sublime. Currently this is what is in my Base File settings:

"auto_complete_triggers":  {"selector": "text.html", "characters": "<"} ]

I would also like to know what the above items refer to, for example, what is ‘selector’? I presume it’s a CSS selector but am not sure…

Any help would be really useful.

Cheers

1 Like

#2

But default, Sublime only triggers when you type letters. It shouldn’t trigger for numbers or symbols. However, because html tags begin with ‘<’, ST is set to trigger autocomplete when you press <. A selector is how Sublime identifies what type of file you’re using and what your scope is within that file. To check your scope, you can press “option+command+p” on OSX or I believe its control+alt+shift+p on windows and linux (but you can check your default keybindings to make sure). The name of all applicable selectors will appear in the statusbar.

As for other uses for this setting, for example, if you use css, you can set autocomplete to trigger on # and have the selector set to source.css. There are many other applications as well.

I hope that makes sense.

0 Likes

#3

Thanks for your reply, it clears a few things up but I am still in need of some assistance. How would I have two selectors: html & css & then two characters: < & #, for example?

0 Likes

#4

I’m not 100% sure what your looking for. My guess is you’re looking for something like: "auto_complete_triggers": {"selector": "text.html, source.css", "characters": "<#"} ]

I just tested this. Apparently css has a problem with autocomplete triggering on # (not sure why).

0 Likes