This plugin lets you add project-specific completion snippets to your .sublime-project
files.
- Download the latest version
- Unzip and rename the folder to ProjectCompletions
- Move the folder into your Packages directory.
and you can add project-specific completions via the completions
key in your .sublime-project
file.
Completions can be specified in two formats.
Just a list of [trigger, completion]
items:
{
"folders": ...
"completions": [
[trigger, completion],
...
[trigger,
completion_part1,
completion_part2,
completion_part3]
]
}
where trigger
is the prefix that triggers the completion (and can contain a caption separated by \t
) and completion
is a snippet.
For more information about the syntax of completions see the Unofficial Documentation.
Using this syntax, the completions will always be available in the project.
A dictionary with scopes as keys and lists of completions as values:
{
"folders": ...
"completions": {
selector: [
[trigger, completion],
...
[trigger,
completion_part1,
completion_part2,
completion_part3]
],
...
selector: [
[trigger, completion],
...
[trigger,
completion_part1,
completion_part2,
completion_part3]
]
}
In this case only the completions associated with selectors matching the current scope will be suggested. For more info about scope selectors see the Unofficial Documentation.
{
"folders": ...
"completions":[
["I", "I am a ${1:snippet} baby!"],
[
"func\tFunctiom",
"def function():\n",
"\t${1:pass}\n"
]
]
}
To see the example in action type I and then press tab: