Remove luasnip

This commit is contained in:
PowerUser64 2021-09-24 09:51:00 -07:00
parent 37575bcd55
commit 0e6c03d0ed
2 changed files with 16 additions and 16 deletions

View file

@ -105,15 +105,15 @@ M.cmp = function()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- luasnip setup -- luasnip setup
local luasnip = require 'luasnip' -- local luasnip = require 'luasnip'
-- nvim-cmp setup -- nvim-cmp setup
local cmp = require 'cmp' local cmp = require 'cmp'
cmp.setup { cmp.setup {
snippet = { snippet = {
expand = function(args) -- expand = function(args)
require('luasnip').lsp_expand(args.body) -- require('luasnip').lsp_expand(args.body)
end, -- end,
}, },
mapping = { mapping = {
['<C-p>'] = cmp.mapping.select_prev_item(), ['<C-p>'] = cmp.mapping.select_prev_item(),
@ -129,8 +129,8 @@ M.cmp = function()
['<Tab>'] = function(fallback) ['<Tab>'] = function(fallback)
if vim.fn.pumvisible() == 1 then if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), 'n') vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), 'n')
elseif luasnip.expand_or_jumpable() then -- elseif luasnip.expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-expand-or-jump', true, true, true), '') -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-expand-or-jump', true, true, true), '')
else else
fallback() fallback()
end end
@ -138,8 +138,8 @@ M.cmp = function()
['<S-Tab>'] = function(fallback) ['<S-Tab>'] = function(fallback)
if vim.fn.pumvisible() == 1 then if vim.fn.pumvisible() == 1 then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-p>', true, true, true), 'n') vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<C-p>', true, true, true), 'n')
elseif luasnip.jumpable(-1) then -- elseif luasnip.jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-jump-prev', true, true, true), '') -- vim.fn.feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-jump-prev', true, true, true), '')
else else
fallback() fallback()
end end
@ -149,7 +149,7 @@ M.cmp = function()
{ name = 'path' }, { name = 'path' },
{ name = 'buffer' }, { name = 'buffer' },
{ name = 'calc' }, { name = 'calc' },
{ name = 'luasnip' }, -- { name = 'luasnip' },
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lua' }, { name = 'nvim_lua' },
{ name = 'spell' }, { name = 'spell' },
@ -166,7 +166,7 @@ M.cmp = function()
path = "[Path]", path = "[Path]",
buffer = "[Buffer]", buffer = "[Buffer]",
calc = "[Calc]", calc = "[Calc]",
luasnip = "[LuaSnip]", -- luasnip = "[LuaSnip]",
nvim_lsp = "[LSP]", nvim_lsp = "[LSP]",
nvim_lua = "[Lua]", nvim_lua = "[Lua]",
spell = "[Spell]", spell = "[Spell]",

View file

@ -73,7 +73,7 @@ return require('packer').startup(function()
require('lsp').cmp() require('lsp').cmp()
end, end,
requires = { -- nvim-cmp sources requires = { -- nvim-cmp sources
"saadparwaiz1/cmp_luasnip", --luasnip integration -- "saadparwaiz1/cmp_luasnip", --luasnip integration
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-buffer",
@ -84,11 +84,11 @@ return require('packer').startup(function()
"hrsh7th/cmp-look", "hrsh7th/cmp-look",
} }
} }
use { -- code snippits -- use { -- code snippits
"L3MON4D3/LuaSnip", -- "L3MON4D3/LuaSnip",
-- "hrsh7th/vim-vsnip", -- -- "hrsh7th/vim-vsnip",
-- "rafamadriz/friendly-snippets", -- -- "rafamadriz/friendly-snippets",
} -- }
use { -- function parameter previews use { -- function parameter previews
"ray-x/lsp_signature.nvim", "ray-x/lsp_signature.nvim",
after = "nvim-lspconfig", after = "nvim-lspconfig",