diff --git a/modules/home-manager/nixvim/plugins/cmp.nix b/modules/home-manager/nixvim/plugins/cmp.nix index 26acd78..6ed68ec 100644 --- a/modules/home-manager/nixvim/plugins/cmp.nix +++ b/modules/home-manager/nixvim/plugins/cmp.nix @@ -17,7 +17,8 @@ autoEnableSources = true; settings = { - snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; + snippet.expand = "function(args) vim.snippet.expand(args.body) end"; + formatting.fields = [ "abbr" "kind" @@ -34,17 +35,25 @@ "" = "cmp.mapping.confirm({ select = true })"; "" = "cmp.mapping.complete()"; "" = '' - cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, {'i', 's'})''; + cmp.mapping( + function() + if vim.snippet.active({ direction = 1 }) then + vim.snippet.jump(1) + end + end, + {'i', 's'} + ) + ''; "" = '' - cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, {'i', 's'})''; + cmp.mapping( + function() + if vim.snippet.active({ direction = -1 }) then + vim.snippet.jump(-1) + end + end, + {'i', 's'} + ) + ''; }; sources = [