Trying to fix snippets

This commit is contained in:
Bryan Ramos 2023-06-02 08:47:58 -04:00
parent 4bef218455
commit 29dc93d387
2 changed files with 8 additions and 2 deletions

View file

@ -53,17 +53,17 @@ vim.cmd [[
local luasnip = require 'luasnip'
cmp.setup {
-- other configurations...
mapping = {
['<Tab>'] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), 'n')
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-y>', true, true, true), 'n')
elseif luasnip.expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-expand-or-jump', true, true, true), '')
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-p>', true, true, true), 'n')
@ -73,6 +73,11 @@ cmp.setup {
fallback()
end
end, { 'i', 's' }),
['<CR>'] = cmp.mapping(function(fallback)
fallback()
end, { 'i', 's' }),
},
}