return { -- TODO: v0.10.0 might have builtins snippets? 'L3MON4D3/LuaSnip', build = 'make install_jsregexp', config = function() local luasnip = require('luasnip') luasnip.setup({}) -- Load snippets. The 'snippets/local' directory is gitignored and holds -- personal snippets that are not tracked; LuaSnip merges it with the -- tracked snippets above. local config_dir = vim.fn.stdpath('config') local opts = { paths = { config_dir .. '/snippets', config_dir .. '/snippets/local', } } require('luasnip.loaders.from_snipmate').lazy_load(opts) require('luasnip.loaders.from_lua').lazy_load(opts) -- Snippet keybindings vim.keymap.set({ 'i', 's' }, '', function() if luasnip.expand_or_jumpable() then luasnip.expand_or_jump() end end, { silent = true }) vim.keymap.set({ 'i', 's' }, '', function() if luasnip.jumpable(-1) then luasnip.jump(-1) end end, { silent = true }) vim.keymap.set({ "i", "s" }, "", function() if luasnip.choice_active() then luasnip.change_choice(1) end end, { silent = true }) vim.keymap.set({ "i", "s" }, "", function() if luasnip.choice_active() then luasnip.change_choice(-1) end end, { silent = true }) end }