Sublime Forum

Can't get sublime-completions file working

#1

I am just starting with Sublime Text 3, and I can’t get an autocomplete file working. I’m also not understanding how to make a scope work for
- ANY file type, or
- MULTIPLE TYPES of files, such as either Java or JavaScript


Following these instructions, I’ve created a file named

C:\Users\jeffy\AppData\Roaming\Sublime Text 3\Packages\User\sublime_specific.sublime-completions

with this:

[code]{
“scope”: “text.plain”,

    "completions":
    
            { "trigger": "sublime", "contents": "sublime.log_commands(${1:True})" },
            { "trigger": "sublime", "contents": "sublime.log_input(${1:True})" },
            { "trigger": "view", "contents": "view.run_command('$1')" },
    ]

}[/code]
I then open a new document, save it as temp.txt, and then start typing “sublime” or “view”. But nothing pops up at any point, even if I hit the “auto_complete” key-command.

How can I get this autocomplete working, and how can I set the scope, so it works in any, or multiple-types of files?

Thanks for helping.

0 Likes

#2

Got it.

The comma at the end of the “run_command” line is a syntax error, which is flagged in the console when the file is saved or Sublime is restarted.

To scope for all files:

"scope": "source, text"

To scope for two types of files:

"scope": "source.java, source.javascript"
1 Like