LazyVim

return {
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
-- install jsregexp (optional!).
build = "make install_jsregexp",
config = function()
-- load snippets paths
require("luasnip.loaders.from_vscode").lazy_load({
paths = { "./snippets/flutter-riverpod-snippets" },
})
end,
},
}
mkdir ~/.config/nvim/snippets
cd ~/.config/nvim/snippets
git clone https://github.com/RobertBrunhage/flutter-riverpod-snippets.git

astronvim

https://quaily.com/ 无法支持 gif, 这里先注释掉

An image to describe post

astronvim snippets 描述的很详细了 说的全是狗屎, 按他的文档根本没法用

编辑

nvim ~/.config/nvim/lua/user/plugins/user.lua

添加这个 plugin

{
"L3MON4D3/LuaSnip",
config = function(plugin, opts)
-- include the default astronvim config that calls the setup call
require "plugins.configs.luasnip"(plugin, opts)
-- load snippets paths
require("luasnip.loaders.from_vscode").lazy_load {
-- this can be used if your configuration lives in ~/.config/nvim
-- if your configuration lives in ~/.config/astronvim, the full path
-- must be specified in the next line
paths = { "./lua/user/snippets/flutter-riverpod-snippets" },
}
end,
},

建立 flutter snippets

mkdir ~/.config/nvim/lua/user/snippets
cd ~/.config/nvim/lua/user/snippets
git clone https://github.com/RobertBrunhage/flutter-riverpod-snippets.git

安装插件

:Lazy sync

随意打开一个 dart 文件, 输入 :LuaSnipListAvailable 可以看到很多 Riverpod 的 snippets

嗯, 开心的使用吧