Remove snippy for luasnip

This commit is contained in:
Marco 2023-11-15 06:21:32 +01:00
parent 880e581c78
commit 9de263590e
3 changed files with 6 additions and 43 deletions

View File

@ -1,9 +1,10 @@
local cmp = require ('cmp')
local cmp = require('cmp')
cmp.setup({
snippet = {
expand = function(args)
require('snippy').expand_snippet(args.body) -- For `snippy` users.
print("expand function")
require('luasnip').lsp_expand(args.body)
end,
},
window = {
@ -19,39 +20,12 @@ cmp.setup({
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'snippy' }, -- For snippy users.
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('lspconfig')['gopls'].setup {

View File

@ -1,11 +0,0 @@
require('snippy').setup({
mappings = {
is = {
['<Tab>'] = 'expand_or_advance',
['<S-Tab>'] = 'previous',
},
nx = {
['<leader>x'] = 'cut_text',
},
},
})

View File

@ -44,8 +44,8 @@ return require('packer').startup(function(use)
use 'hrsh7th/nvim-cmp'
-- Snippets
use 'dcampos/nvim-snippy'
use 'dcampos/cmp-snippy'
use { "L3MON4D3/LuaSnip" }
use { 'saadparwaiz1/cmp_luasnip' }
-- Project explorer
use { 'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons' }