Ive just started using the sniptMate plugin for VIM and love it, however, since my collection of snippets isn\'t huge, I\'d like to be able to add new snippets dynamically rathe
I'm not sure it's meant to be done like this but you can try calling the MakeSnip
function from within file you're currently working on. For example:
:call MakeSnip(&ft, "foo", "${1} ")
&ft
will pass the filetype of the file you're currently editing, "foo"
is the trigger and "
is the replacement text.
Of course, snippets created like this won't persist. So why not have the snippets file open in another buffer, define new snippets there as necessary, then do:
:call ReloadSnippets(&ft)
and your new snippet will be available. You could even define an autocmd to call the ReloadSnippets
function when you write the snippets file.