diff --git a/.gitmodules b/.gitmodules index c7caede..6ea21c8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -38,10 +38,6 @@ path = pack/plugins/start/neogit url = git@github.com:NeogitOrg/neogit.git ignore = dirty -[submodule "pack/plugins/start/LuaSnip"] - path = pack/plugins/start/LuaSnip - url = git@github.com:L3MON4D3/LuaSnip.git - ignore = dirty [submodule "pack/plugins/start/nvim-dap-virtual-text"] path = pack/plugins/start/nvim-dap-virtual-text url = git@github.com:theHamsta/nvim-dap-virtual-text.git @@ -98,10 +94,6 @@ path = pack/plugins/start/cmp-buffer url = git@github.com:hrsh7th/cmp-buffer.git ignore = dirty -[submodule "pack/plugins/start/cmp_luasnip"] - path = pack/plugins/start/cmp_luasnip - url = git@github.com:saadparwaiz1/cmp_luasnip.git - ignore = dirty [submodule "pack/plugins/start/cmp-nvim-lsp"] path = pack/plugins/start/cmp-nvim-lsp url = git@github.com:hrsh7th/cmp-nvim-lsp.git diff --git a/init.lua b/init.lua index facd941..03eaa8c 100755 --- a/init.lua +++ b/init.lua @@ -117,6 +117,15 @@ vim.keymap.set({ 'i', 't' }, '', 'tabclose', { noremap = true vim.keymap.set('', ']t', vim.cmd.tabnext, { noremap = true, desc = 'Go to next tab' }) vim.keymap.set('', '[t', vim.cmd.tabprevious, { noremap = true, desc = 'Go to next tab' }) +-- Snippets +vim.keymap.set({ 'i', 's' }, '', function() + if vim.snippet.active({ direction = 1 }) then + return 'lua vim.snippet.jump(1)' + else + return '' + end +end, { expr = true }) + -- Other vim.keymap.set('', 'cd', 'cd %:h', { noremap = true, desc = 'Change directory to current file folder' }) vim.keymap.set('', '', 'buffer #', { noremap = true, desc = 'Back to previous buffer' }) diff --git a/pack/plugins/start/LuaSnip b/pack/plugins/start/LuaSnip deleted file mode 160000 index de1a287..0000000 --- a/pack/plugins/start/LuaSnip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit de1a287c9cb525ae52bc846e8f6207e5ef1da5ac diff --git a/pack/plugins/start/cmp_luasnip b/pack/plugins/start/cmp_luasnip deleted file mode 160000 index 05a9ab2..0000000 --- a/pack/plugins/start/cmp_luasnip +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 05a9ab28b53f71d1aece421ef32fee2cb857a843 diff --git a/plugin/cmp.lua b/plugin/cmp.lua index 185bd09..60ac805 100644 --- a/plugin/cmp.lua +++ b/plugin/cmp.lua @@ -1,4 +1,3 @@ -local luasnip = require('luasnip') local cmp = require('cmp') local cmp_autopairs = require('nvim-autopairs.completion.cmp') @@ -36,7 +35,6 @@ local completion_types = { cmp.setup({ sources = { { name = 'nvim_lsp' }, - { name = 'luasnip' }, { name = 'crates' }, { name = 'git' }, { name = 'buffer' }, @@ -55,7 +53,7 @@ cmp.setup({ end, }), snippet = { - expand = function(args) luasnip.lsp_expand(args.body) end, + expand = function(args) vim.snippet.expand(args.body) end, }, formatting = { fields = { 'kind', 'abbr', 'menu' }, diff --git a/plugin/luasnip.lua b/plugin/luasnip.lua deleted file mode 100644 index f955ac9..0000000 --- a/plugin/luasnip.lua +++ /dev/null @@ -1,6 +0,0 @@ -local luasnip = require('luasnip') - -for _, mode in ipairs({ 's', 'i' }) do - vim.keymap.set(mode, '', luasnip.expand_or_jump, { desc = 'Jump to next snippet' }) - vim.keymap.set(mode, '', function() luasnip.jump(-1) end, { desc = 'Jump to previous snippet' }) -end