mirror of
https://github.com/hrsh7th/nvim-cmp
synced 2024-09-16 20:54:03 +02:00
feat: default to vim.snippet
for snippet expansion if available (#1820)
This commit is contained in:
parent
763c720d51
commit
66f0a031d9
3 changed files with 5 additions and 1 deletions
|
@ -68,6 +68,7 @@ lua <<EOF
|
|||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
|
|
|
@ -85,6 +85,7 @@ A recommended configuration can be found below.
|
|||
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- require'snippy'.expand_snippet(args.body) -- For `snippy` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
|
|
|
@ -29,7 +29,9 @@ return function()
|
|||
mapping = {},
|
||||
|
||||
snippet = {
|
||||
expand = function(_)
|
||||
expand = vim.snippet and function(args)
|
||||
vim.snippet.expand(args.body)
|
||||
end or function(_)
|
||||
error('snippet engine is not configured.')
|
||||
end,
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue