You've already forked dotfiles
configurations and using newer built-in functionality in the 0.12.x versions of Neovim. Further work is needed for treesitter updates, cleanup of the conversion work and testing to verify old functionality isn't lessened to get the benefits of a cleaner config and vastly faster load times.
21 lines
825 B
Lua
21 lines
825 B
Lua
vim.pack.add({
|
|
'https://github.com/saadparwaiz1/cmp_luasnip',
|
|
'https://github.com/rafamadriz/friendly-snippets',
|
|
'https://github.com/L3MON4D3/LuaSnip'
|
|
})
|
|
|
|
local luasnip_lua_path = vim.api.nvim_get_runtime_file('lua/luasnip/init.lua', false)[1]
|
|
if not luasnip_lua_path then return end
|
|
local luasnip_root = vim.fn.fnamemodify(luasnip_lua_path, ':h:h:h')
|
|
|
|
vim.api.nvim_create_autocmd('PackChanged', { callback = function(args)
|
|
local name, kind = args.data.spec.name, args.data.kind
|
|
if name == 'luasnip' and kind == 'update' then
|
|
if not args.data.active then vim.cmd.packadd('luasnip') end
|
|
vim.system({'make', 'install_jsregexp'}, { cwd = luasnip_root })
|
|
end
|
|
end})
|
|
|
|
require('luasnip.loaders.from_vscode').lazy_load()
|
|
require('luasnip.loaders.from_lua').lazy_load({ paths = "./snippets" })
|