feat(plugin): addcustom snippet provider configuration

Added dedicated snippet provider with configurable search paths and extended filetype support for MDX, while replacing the legacy LuaSnip preset with the default preset and updating fuzzy settings.

- New Features
  - Introduced custom snippet provider loading snippets from `config/snippets`
  - Enabled MDX completion as markdown
- Enhancements
  - Switched snippet preset from `luasnip` to `default`
  - Updated fuzzy implementation to `prefer_rust`
  - Removed legacy LuaSnip loader calls
This commit is contained in:
sankalp committed 2026-05-18 21:43:38 +05:45
1 parent 602a240d8d
commit 5f67b0fd94
1 file changed
+9 -9
+9 -9
View File
@@ -1,13 +1,12 @@
add({ add({
"saghen/blink.lib", "saghen/blink.lib",
{ src = "saghen/blink.cmp", build = "cargo build --release" }, { src = "saghen/blink.cmp", build = "cargo build --release" },
{ src = "L3MON4D3/LuaSnip", build = "make install_jsregexp" },
"rafamadriz/friendly-snippets", "rafamadriz/friendly-snippets",
}) })
require("blink.cmp").setup({ require("blink.cmp").setup({
fuzzy = { implementation = "prefer_rust" }, fuzzy = { implementation = "prefer_rust" },
snippets = { preset = "luasnip" }, snippets = { preset = "default" },
sources = { sources = {
default = function() default = function()
local type = vim.fn.getcmdtype() local type = vim.fn.getcmdtype()
@@ -15,6 +14,14 @@ require("blink.cmp").setup({
if type == ":" then return { "cmdline" } end if type == ":" then return { "cmdline" } end
return { "lsp", "path", "snippets", "buffer" } return { "lsp", "path", "snippets", "buffer" }
end, end,
providers = {
snippets = {
opts = {
search_paths = { vim.fn.stdpath("config") .. "/snippets" },
extended_filetypes = { mdx = { "markdown" } },
},
},
},
}, },
completion = { completion = {
@@ -70,10 +77,3 @@ require("blink.cmp").setup({
}, },
}) })
local luasnip = require("luasnip")
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({
paths = { vim.fn.stdpath("config") .. "/snippets" },
})
luasnip.filetype_extend("mdx", { "markdown" })