Skip to content

Instantly share code, notes, and snippets.

@joy2fun
Last active August 29, 2015 14:03
Show Gist options
  • Save joy2fun/98b27060790c50a8470c to your computer and use it in GitHub Desktop.
Save joy2fun/98b27060790c50a8470c to your computer and use it in GitHub Desktop.
Another way to extract snippets files for vim plugin snipMate
"use common-separated names to load multi snippets files for specific file type
"call LoadSnippets('vim,html') will load vim.snippets and html.snippets
fun! LoadSnippets(p, ft)
call ResetSnippets(a:ft)
" always include global snippets
let snips = split('_,'.a:p, ',')
for name in snips
call ExtractSnipsFile(g:snippets_dir . name . '.snippets', a:ft)
endfor
endfun
"command to load snippets files for current filetype
com! -nargs=1 Snip call LoadSnippets(<f-args>, &ft)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment