forked from Binocular222/Sublime-Text-3-Full-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AutoComplete.txt
39 lines (38 loc) · 5.45 KB
/
AutoComplete.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
http://www.sublimetext.com/docs/3/auto_complete.html
http://docs.sublimetext.info/en/latest/reference/completions.html
Type a few characters → Auto complete list popup as you type → Tab or Enter to choose
Force open by Ctrl+spacebar
Ctrl+spacebar to select next entry
Enabled by default for source code and HTML (but only after entering a < character).
Autocomplete list comes from (priority from highest to lowest):
.sublime-snippet [[Snippet.txt]]
only fire if exact match of trigger
Show up in the completions list in the pattern: <tab_trigger> : <description>
API-injected completions, i.e: EventListener.on_query_completions()
.sublime-completions
scope = Determines whether the completions are to be sourced from this file
completions = Array of completions
trigger = Text displayed in the completions list. When select will insert contents
contents = Text to be inserted. Can use snippet features.
Example:
{
"scope": "text.html - source - meta.tag, punctuation.definition.tag.begin",
"completions":
[
"attrstamp", //trigger and content is the same
{ "trigger": "acronym", "contents": "<acronym>$0</acronym>" }, //acronym → <acronym></acronym> with the cursor placed in the $0 position
{ "trigger": "assert", "contents": "assert ${1:condition}, ${2:message}" }, //mimic Snippet syntax [[Snippet.txt]]
]
}
Words in the buffer
Can specify condition to ignore autocomplete via [[tmPreferences.txt#cancelCompletion]]
Menu bar > Preferences > Settings:
"tab_completion": true, //Shift+Tab/Shift+enter to ignore Autocompletion
"auto_complete": true, // Enable auto complete to be triggered automatically when typing.
"auto_complete_size_limit": 4194304, // The maximum file size where auto complete will be automatically triggered.
"auto_complete_delay": 50, // The delay, in ms, before the auto complete window is shown after typing
"auto_complete_selector": "source - comment", // Controls what scopes auto complete will be triggered in
"auto_complete_triggers": [ {"selector": "text.html", "characters": "<"} ], // Additional situations to trigger auto complete
"auto_complete_commit_on_tab": false, // By default, auto complete will commit the current completion on enter.
"auto_complete_with_fields": false, // Controls if auto complete is shown when snippet fields are active.
"word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?", // Characters to separate words and not trigger Autocomplete