garbas/vim-snipmate

alias feature

MarcWeber opened this issue · 10 comments

Often snippets get renamed, so we should think about introducing an alias feature, or allow many keys to trigger a snippet.

One use case is:
honza/vim-snippets#196

I also notified SirVer about how he thinks about aliases.

One possible implementation is here:
https://github.com/Shougo/neosnippet.vim/blob/master/doc/neosnippet.txt
I like that those snippets have an head

Should we work on common extensible snippet syntax ?

This has never been requested for UltiSnips so I am kinda meh. It would be easy enough to implement though and the use case from the merge request seems valid.

That said people would still need to clear() the trigger they don't like. So I am still meh :)

Thinking about it again eventually making "snippet rewriting" on the fly easy is a better way to solve "all" of such cases. See hints in other issue. For "renaming" cases alias may still be useful - keeping it open for that reason

This shouldn't be too hard to implement, but I'm not sure I understand the use case. I don't see any use for it outside of a name change in a snippet repository, which to me seems like a fairly limited use case. Maybe I'm alone in this, but I've always thought of snippets as a personal part of one's dotfiles, with the repositories being a nice starting point. Though I'm not entirely against this, I've always thought that one of SnipMate's strengths is its simplicity.

@MarcWeber, what do you mean by "snippet rewriting"?

@ajzafar I share your opinion about snippets being something very personal, so I share your opinion of this feature. But it is easy to implement, so I am meh :)

I'd like alias feature too.

Sometimes, trying to be faster than I really am, I don't type the snippet last key, like: cl<tab> instead of cla<tab>, aliases could help me in this cases.

+1

agreed. This would be really great.