Ok mate. Sublime Text’s just awesome, so you’re not allowed to waste it So, find a course, and start learning:
english: https://www.youtube.com/watch?v=SVkR1ZkNusI&list=PLpcSpRrAaOaqQMDlCzE_Y6IUUzaSfYocK
french: https://www.youtube.com/playlist?list=PLjDTyz7qfUnNnVHzGlnzzoNedFu1rB1sS
It’s maybe gonna take 1 hour, I promise that in what, 2 days, you will have caught up on this “wasted” time, and you’ll keep saving time.
So, just a quick explaination:
Your settings are just JSON
files. To keep it simple, you have 2 settings file: The default one, there’s all the default settings in it, commented. do not edit it. Each time you’ll update ST, it’ll be overwritten. As you probably guessed, there’s a User one. You put your custom settings in this one. The user one overwrites the default one.
To open this, go to Preferences -> Settings
. On the left, it’s the default one, on the right, the user one.
So, there is the default completion, which uses the words in your current file and your snippets (maybe you don’t know what that is, but don’t worry, it’s explained in both of the courses )
And it’s the settings auto_complete_selector
that controls in which scope the auto completion triggers. If you look in your default setting file, you’ll find it.
"auto_complete_selector": "meta.tag - punctuation.definition.tag.begin, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
from stackoverflow
it’s possible to AND, OR, and subtract scope selectors, e.g.: (a | b) & c - d
would select the scope which is not matched by d, and matched by both c, and a or b.
As you can see, the default auto completion doesn’t trigger in string, because of this:
- string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc
neither in comment:
- comment
So, do you have installed any packages? Apparently yes, the Typescript
one. And it’s this one that doesn’t respect the settings auto_complete_selector
, and propose you some completion when you don’t want.
In your case, the plugin has build properly: you’ve can change this setting:
"auto_complete_triggers" : [ {"selector": "source.ts", "characters": "."} ],
So, this is a settings for the packages, which means you have to set it in the Packages Settings, not in your global one.
For this, go to:
Preferences -> Packages Settings -> Type Script -> TypeScript Settings – User
And set this a content:
{
"auto_complete_triggers" : [ {"selector": "source.ts - string", "characters": "."} ]
}
tl;dr: I took the time to write it, why wouldn’t you read it?
Hope it helps. If you have any question, ask!
matt