Skip to content

How to cope with UltiSnips and snipmate issues? #363

Closed
@MarcWeber

Description

@MarcWeber

Historically UltiSnips (depending on Vim with Python) introduced UltiSnippets and Snipmate introduced "snippets" files. Today UltiSnips can read both, but snipmate cannot. UltiSnips has "advanced" features which are useful in some cases such as "nested snippets" and special triggers - Marc Weber never felt need for special triggers in snipmate because it historically had snippet completion while triggering - and passing arguments to snippets by trigger can be emulated by input() which requires hitting one additional time. Thus which features are worth having or not depends heavily on the judgment of the user.

The big question now is: How should vim-snippets cope with it? Nice habits to keep in mind:

  • prevent duplication (do it once)
  • please users as much as possible

The most simple strategy could be:

  • Put simple snippets in .snippets files
  • If you have complex advanced alternatives think use UltiSnips files
    judgment of this idea:
  • least snippet duplication
  • it serves everybody as much as possible, duplicates can be "ignored" by telling engines to use first hit and making sure engines read the .snippet files first
  • UltiSnips users have to open and look at two files

This is Marc Weber's favorite solution for now. One example following this is "html_minimal" example.

Please use this issue to discuss alternative solutions emphasizing on why they are better/worse than what I'm proposing above (which is already documented in the README).

If you're fine with the proposal only reply if it looks like the thread comes to a different solution. I'd suggest waiting for about 4 weeks for people to put their opinions.
There is no hurry.

I commented here that I added those comments to the README:
#355

The first PR following this suggestion appeared shortly after:
#362

There is an additional issue: Snippet engines support multiple files anyway: Should there be a simple command which allows finding the file defining a snippet? A simple grep all snippet files being used would be enough probably (eg using grepadd or such). That would be trivial to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions