0

I find it rather surprising and a bit of a usability blunder by the Sublime team not to allow creation of custom snippets in one file and instead making you:

  1. put each snippet into a separate file
  2. make you choose the directory to save file each time without allowing to define some sort of sensible default path
  3. not allowing you to view your snippets properly and notify of any conflicts
  4. not allowing you to define any sort of priority for these snippets

Now, I love ST2, but this is kinda bugging me, so I come to you, the all mighty SO, to help me with these. I am absolutely open to the possibility that all of the above is easily amended, and I was dense enough not to find the way.*

DISCLAIMER: I know about Zen-Coding/Emmet. It's too much for my liking. I also am not a Python person, but if that's the only thing standing between me and happiness, I am willing to take a dive.

4

1 回答 1

3

Months ago, I spend a lot of time trying to make a plugin that would replace the current snippet system with something that would take all of the concerns you listed into account. I never got around to finishing it so it's really buggy but it's available on github for anyone who wants to contribute here: SMART-Snippets

But I would not really recommend it for you, just figured I'd mention it. You might want to look into completion files. They are essentially snippet files with multiple snippets. You can also take a look at HTML/html_completions.py in the ST packages folder (Preferences > Browse Packages).

As for the directory issue, I understand the woe. I don't know if there's a simple way to specify a directory but if there's not, it wouldn't be a hard plugin to write. I could write it when I have some free time.

I don't have an answer for the conflicts issue. I suppose using a completions file would simplify this. Sorry.

Priority is explained in the docs.

Hope that's some help.

于 2012-12-13T04:35:32.847 回答