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

@ -3,7 +3,8 @@ local cmp = require ('cmp')
cmp.setup({ cmp.setup({
snippet = { snippet = {
expand = function(args) expand = function(args)
require('snippy').expand_snippet(args.body) -- For `snippy` users. print("expand function")
require('luasnip').lsp_expand(args.body)
end, end,
}, },
window = { window = {
@ -19,39 +20,12 @@ cmp.setup({
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'snippy' }, -- For snippy users. { name = 'luasnip' },
}, { }, {
{ name = 'buffer' }, { 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. -- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('lspconfig')['gopls'].setup { 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' use 'hrsh7th/nvim-cmp'
-- Snippets -- Snippets
use 'dcampos/nvim-snippy' use { "L3MON4D3/LuaSnip" }
use 'dcampos/cmp-snippy' use { 'saadparwaiz1/cmp_luasnip' }
-- Project explorer -- Project explorer
use { 'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons' } use { 'nvim-tree/nvim-tree.lua', requires = 'nvim-tree/nvim-web-devicons' }