From the source code, it appears this plugin is determining which snippet files to load based on file/directory names. Unfortunately, this doesn't work for a lot of the friendly-snippets files. A few examples of snippets not loading for their filetype are:
vue, angular, django, etc. snippets in in snippets/frameworks/**/*.json (maybe because there are additional subdirectories?)
dockerfile snippets in snippets/docker/docker_file.json
sh snippets in snippets/shell/*.json
Additionally, typescript, react, nextjs, etc. snippets are incorrectly loaded in javascript files, because they are all in snippets/javascript/*.json.
Potential solution
It would be nice if this plugin parsed the package.json data to determine which snippet files to load. If that's out of this plugin's scope, then special cases would be needed to support friendly-snippets like the readme mentions.
Partial workaround
Some of the filename/filetype mismatches can be (kind of) resolved with the extend_filetypes config option, for example:
extended_filetypes = {
sh = { "shell" },
dockerfile = { "docker" }, -- loads unrelated docker-compose snippets too
yaml = { "docker" }, -- for docker-compose users
}
Unfortunately, I haven't found a way to prevent typescript, react, etc. snippets from appearing in javascript files or a way to get vue, angular, etc. snippets to load.
Bug
From the source code, it appears this plugin is determining which snippet files to load based on file/directory names. Unfortunately, this doesn't work for a lot of the
friendly-snippets
files. A few examples of snippets not loading for their filetype are:vue
,angular
,django
, etc. snippets in insnippets/frameworks/**/*.json
(maybe because there are additional subdirectories?)dockerfile
snippets insnippets/docker/docker_file.json
sh
snippets insnippets/shell/*.json
Additionally, typescript, react, nextjs, etc. snippets are incorrectly loaded in
javascript
files, because they are all insnippets/javascript/*.json
.Potential solution
It would be nice if this plugin parsed the
package.json
data to determine which snippet files to load. If that's out of this plugin's scope, then special cases would be needed to supportfriendly-snippets
like the readme mentions.Partial workaround
Some of the filename/filetype mismatches can be (kind of) resolved with the
extend_filetypes
config option, for example:Unfortunately, I haven't found a way to prevent typescript, react, etc. snippets from appearing in javascript files or a way to get vue, angular, etc. snippets to load.