Home Download Buy Blog Forum Support

New Unofficial Docs: Completions

Re: New Unofficial Docs: Completions

Postby Esseb on Thu Mar 10, 2011 4:30 pm

What is the best way to modify or remove default snippets or completions?

Adding the canvas element to HTML can be done easily by adding it to Packages\User\HTML\HTML.sublime-completions.

However, what if I want to get rid of the frameset element defined in Packages\HTML\HTML.sublime-completions? Or if I want to change the html snippet defined in Packages\HTML\html.sublime-snippet to include a <!DOCTYPE html>?

If I copy html.sublime-snippet over to Packages\User\HTML and edit it there, both will exist, instead of the one in Packages\HTML being overridden. And HTML.sublime-completions from both Packages\HTML and Packages\User\HTML are in use, so even if frameset isn't defined in Packages\HTML\HTML.sublime-completions it still exists.

Should I just edit the files directly in Packages\HTML? That doesn't seem very clean, and won't they get recreated on upgrade?
Posts: 8
Joined: Wed May 12, 2010 7:20 pm

Re: New Unofficial Docs: Completions

Postby guillermooo on Thu Mar 10, 2011 4:55 pm

If you reach a point where you need to make substantial changes to a shipped package, there aren't many options left short of maintaining your own version.

What you could do in this case, though, is split the default HTML.sublime-completions in two files, say HTML (Main).sublime-completions and HTML (Additional).sublime-completions, and ask for them to be included in the default installation. That way you could rename one of them to deactivate the completions in it, even between upgrades.

There's a public repo on google code for Sublime Packages. I don't know whether it's in sync with the packages shipped with Sublime, but it's a starting point.
Posts: 739
Joined: Thu Jul 23, 2009 9:06 am

Re: New Unofficial Docs: Completions

Postby Esseb on Thu Mar 10, 2011 5:07 pm

Hm, I might have to maintain my own version, then. Many of the changes I'm interested in doing would not be of interest to anyone else.

I'll see about contributing to the public repo. Canvas and other HTML5 elements should at least be included by default.
Posts: 8
Joined: Wed May 12, 2010 7:20 pm


Return to General Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot], ZakkiOrichalcum and 36 guests