Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programmatically Inserting Snippet #230

Open
flukus opened this issue May 21, 2016 · 3 comments
Open

Programmatically Inserting Snippet #230

flukus opened this issue May 21, 2016 · 3 comments
Assignees

Comments

@flukus
Copy link

flukus commented May 21, 2016

Is there/could there be, a way to insert snippets programmatically?

For example, as part of another script I want to have a AddClass fucntion that creates a file in the right place and inserts a snippet. Rather than trying to insert text and feeding the tab key etc, which feels quite hacky and fragile, it would be nice to be able to call snpmate#InsertSnipmate('MySnippet').

@ajzafar
Copy link
Collaborator

ajzafar commented May 30, 2016

This will most likely happen at some point.

@roxma
Copy link

roxma commented Mar 12, 2017

:help SnipMate-snippet-sources

See example 2, you could implement your own source.

@roxma
Copy link

roxma commented Mar 12, 2017

roxma/nvim-completion-manager@44f2ad8#diff-04b6c3103be5dc342a512babed30d83fR495

This example shows how I inject snippet into snipmate programmatically, and implement function parameter expansion.

@ajzafar ajzafar self-assigned this Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants