2022-01-08 18:08:41 +00:00
|
|
|
local status_ok, luasnip = pcall(require, "luasnip")
|
|
|
|
if not status_ok then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
if vim.g.snippets ~= "luasnip" then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2022-01-12 07:28:19 +00:00
|
|
|
local javascript = R "opdavies.snippets.ft.javascript"
|
|
|
|
local markdown = R "opdavies.snippets.ft.markdown"
|
|
|
|
local php = R "opdavies.snippets.ft.php"
|
2022-01-09 01:08:48 +00:00
|
|
|
|
|
|
|
local snippets = {
|
|
|
|
js = javascript,
|
2022-01-10 01:29:21 +00:00
|
|
|
markdown = markdown,
|
2022-01-09 01:08:48 +00:00
|
|
|
php = php,
|
|
|
|
typescript = javascript,
|
|
|
|
vue = javascript,
|
2022-01-08 18:08:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
luasnip.snippets = snippets
|
|
|
|
|
|
|
|
vim.cmd [[
|
|
|
|
imap <silent><expr> <c-k> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : ''
|
|
|
|
inoremap <silent> <c-j> <cmd>lua require('luasnip').jump(-1)<CR>
|
|
|
|
imap <silent><expr> <C-l> luasnip#choice_active() ? '<Plug>luasnip-next-choice' : '<C-l>'
|
|
|
|
snoremap <silent> <c-k> <cmd>lua require('luasnip').jump(1)<CR>
|
|
|
|
snoremap <silent> <c-j> <cmd>lua require('luasnip').jump(-1)<CR>
|
|
|
|
]]
|