Last active
August 29, 2015 14:03
-
-
Save joy2fun/98b27060790c50a8470c to your computer and use it in GitHub Desktop.
Another way to extract snippets files for vim plugin snipMate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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