Extend snippet filetypes in blink.cmp
blink.cmp is a completion plugin for
Neovim. It ships with lazyvim and is pretty nice.
Among its many sources, it completes
snipepts, by default
from the friendly-snippets
repository, which provides snippets by language (e.g., markdown) and by
framework (e.g., jekyll).
Framework support is disabled by default and needs to be explicitly enabled.
There was no documentation on how to do that for blink.cmp, but the code had
built-in support for it through the extended_filetypes configuration
option.
It was there all along, just a bit undocumented!
--- @field extended_filetypes? table<string, string[]>
I figured this out by doing a quick code dive. Then, I updated my configuration to enable extended Markdown snippets in Jekyll and submitted a PR to improve the docs.
Here is how to extend filetypes in lazy.nvim:
return {
{
"saghen/blink.cmp",
opts = {
sources = {
providers = {
snippets = {
opts = {
extended_filetypes = { markdown = { "jekyll" } },
},
},
},
},
},
},
}