local status_ok, luasnip = pcall(require, "luasnip") if not status_ok then return end if vim.g.snippets ~= "luasnip" then return end local javascript = require "opdavies.snippets.ft.javascript" local markdown = require "opdavies.snippets.ft.markdown" local php = require "opdavies.snippets.ft.php" local snippets = { js = javascript, all = markdown, php = php, typescript = javascript, vue = javascript, } luasnip.snippets = snippets vim.cmd [[ imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' inoremap lua require('luasnip').jump(-1) imap luasnip#choice_active() ? 'luasnip-next-choice' : '' snoremap lua require('luasnip').jump(1) snoremap lua require('luasnip').jump(-1) ]]