@lpil the way I do this for my own snippets is to invent my own file types for libraries and then have a project local vimrc that sets those filetypes.
For example, if I have a ruby project using the rspec library my project-local vimrc might contain something like
augroup ExtraTypes
autocmd!
autocmd BufNewFile,BufRead *_spec.rb set ft+=.rspec
augroup end