Prevent Sublime Text 3 from tab completing 'sup' to '<sup>' in a non-HTML file

228 Views Asked by At

When I type sup then TAB in Sublime Text 3, I get <sup>. That isn't what I want; I only want tab completions based on what is in my current file.

How can I limit tag style tag-completions to just HTML files?

I was hoping to find a setting called tag_complete_file_extensions or similar.

I don't currently understand the implications of these default preference settings, but they don't look like what I want:

{
  // Controls what scopes auto complete will be triggered in
  "auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",

  // Additional situations to trigger auto complete
  "auto_complete_triggers": [ {"selector": "text.html", "characters": "<"} ],
}

At the least, I'd appreciate an answer pointing me in the right direction. I don't mind forking a package or writing some custom code.

1

There are 1 best solutions below

1
On

I believe this behaviour is provided by the Emmet (formerly ZenCoding), or similar package and not sublime directly.

Are you sure syntax is set accordingly for the files you get html tag completion?

By default Emmet detects that you are working on html files and enables tag completion (in my case I did not have to configure anything to get this functionality). You should have a closer look at your packages and your configuration and possibly update existing ones.

If you need any further help with the configuration files, I'm happy to help!

Cheers!