changeset 484:bed1479d9b10

Replace vsnip with luasnip
author zegervdv <zegervdv@me.com>
date Tue, 09 Nov 2021 12:24:39 +0100
parents 160e93d776f3
children 4ad3b5ada36b
files .chezmoitemplates/config.vim .chezmoitemplates/init.lua
diffstat 2 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/.chezmoitemplates/config.vim	Fri Nov 05 15:52:44 2021 +0100
+++ b/.chezmoitemplates/config.vim	Tue Nov 09 12:24:39 2021 +0100
@@ -12,11 +12,6 @@
 endif
 source $VIMRUNTIME/ftplugin/man.vim
 
-if has('packages')
-  silent! packadd! log_file
-  silent! packadd! snippets
-endif
-
 packadd vim-dirvish
 
 if has("nvim")
--- a/.chezmoitemplates/init.lua	Fri Nov 05 15:52:44 2021 +0100
+++ b/.chezmoitemplates/init.lua	Tue Nov 09 12:24:39 2021 +0100
@@ -218,13 +218,13 @@
     use { 'neovim/nvim-lspconfig' }
     use {
       'hrsh7th/nvim-cmp',
-      requires = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-vsnip', 'hrsh7th/cmp-path' },
+      requires = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-path' },
       config = function()
         local cmp = require 'cmp'
         cmp.setup {
           snippet = {
             expand = function(args)
-              vim.fn['vsnip#anonymous'](args.body)
+              require('luasnip').lsp_expand(args.body)
             end,
           },
           mapping = {
@@ -240,7 +240,7 @@
           sources = {
             { name = 'nvim_lsp' },
             { name = 'buffer', keyword_length = 5 },
-            { name = 'vsnip' },
+            { name = 'luasnip' },
             { name = 'path' },
           },
           experimental = {
@@ -249,6 +249,7 @@
           },
         }
       end,
+      after = 'luasnip',
     }
     use {
       {
@@ -292,7 +293,7 @@
       'nvim-treesitter/nvim-treesitter-textobjects',
       { 'nvim-treesitter/playground', opt = true },
     }
-    use { 'hrsh7th/vim-vsnip', requires = 'hrsh7th/vim-vsnip-integ' }
+    use { 'L3MON4D3/luasnip' }
     use {
       'rmagatti/goto-preview',
       config = function()