comparison .chezmoitemplates/init.lua @ 484:bed1479d9b10

Replace vsnip with luasnip
author zegervdv <zegervdv@me.com>
date Tue, 09 Nov 2021 12:24:39 +0100
parents 160e93d776f3
children 4ad3b5ada36b
comparison
equal deleted inserted replaced
483:160e93d776f3 484:bed1479d9b10
216 216
217 -- Completion/snippets/LSP 217 -- Completion/snippets/LSP
218 use { 'neovim/nvim-lspconfig' } 218 use { 'neovim/nvim-lspconfig' }
219 use { 219 use {
220 'hrsh7th/nvim-cmp', 220 'hrsh7th/nvim-cmp',
221 requires = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-vsnip', 'hrsh7th/cmp-path' }, 221 requires = { 'hrsh7th/cmp-buffer', 'hrsh7th/cmp-nvim-lsp', 'saadparwaiz1/cmp_luasnip', 'hrsh7th/cmp-path' },
222 config = function() 222 config = function()
223 local cmp = require 'cmp' 223 local cmp = require 'cmp'
224 cmp.setup { 224 cmp.setup {
225 snippet = { 225 snippet = {
226 expand = function(args) 226 expand = function(args)
227 vim.fn['vsnip#anonymous'](args.body) 227 require('luasnip').lsp_expand(args.body)
228 end, 228 end,
229 }, 229 },
230 mapping = { 230 mapping = {
231 ['<C-p>'] = cmp.mapping.select_prev_item(), 231 ['<C-p>'] = cmp.mapping.select_prev_item(),
232 ['<C-n>'] = cmp.mapping.select_next_item(), 232 ['<C-n>'] = cmp.mapping.select_next_item(),
238 }, 238 },
239 }, 239 },
240 sources = { 240 sources = {
241 { name = 'nvim_lsp' }, 241 { name = 'nvim_lsp' },
242 { name = 'buffer', keyword_length = 5 }, 242 { name = 'buffer', keyword_length = 5 },
243 { name = 'vsnip' }, 243 { name = 'luasnip' },
244 { name = 'path' }, 244 { name = 'path' },
245 }, 245 },
246 experimental = { 246 experimental = {
247 native_menu = false, 247 native_menu = false,
248 ghost_text = true, 248 ghost_text = true,
249 }, 249 },
250 } 250 }
251 end, 251 end,
252 after = 'luasnip',
252 } 253 }
253 use { 254 use {
254 { 255 {
255 'nvim-treesitter/nvim-treesitter', 256 'nvim-treesitter/nvim-treesitter',
256 config = function() 257 config = function()
290 }, 291 },
291 'nvim-treesitter/nvim-treesitter-refactor', 292 'nvim-treesitter/nvim-treesitter-refactor',
292 'nvim-treesitter/nvim-treesitter-textobjects', 293 'nvim-treesitter/nvim-treesitter-textobjects',
293 { 'nvim-treesitter/playground', opt = true }, 294 { 'nvim-treesitter/playground', opt = true },
294 } 295 }
295 use { 'hrsh7th/vim-vsnip', requires = 'hrsh7th/vim-vsnip-integ' } 296 use { 'L3MON4D3/luasnip' }
296 use { 297 use {
297 'rmagatti/goto-preview', 298 'rmagatti/goto-preview',
298 config = function() 299 config = function()
299 require('goto-preview').setup {} 300 require('goto-preview').setup {}
300 end, 301 end,