Skip to content

Instantly share code, notes, and snippets.

@fishman
Created March 19, 2009 23:33
Show Gist options
  • Save fishman/82129 to your computer and use it in GitHub Desktop.
Save fishman/82129 to your computer and use it in GitHub Desktop.
fun! GetSnippets(dir)
let snippetFiles = split(globpath(expand(a:dir), '**/*.snippet'), '\n')
for fullpath in snippetFiles
let tail = strpart(fullpath, strlen(expand(a:dir)))
let ft = substitute(tail, '^/\([^/]*\).*', '\1', '')
let keyword = substitute(tail, '^/[^/]*\(.*\)', '\1', '')
if !exists('g:did_ft_{ft}')
call ExtractSnips(fullpath, ft)
endif
endfor
endf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment