diff --git a/dotfiles/.config/nvim/lua/plugins/init.lua b/dotfiles/.config/nvim/lua/plugins/init.lua index 719c3d8..61e0a61 100644 --- a/dotfiles/.config/nvim/lua/plugins/init.lua +++ b/dotfiles/.config/nvim/lua/plugins/init.lua @@ -24,21 +24,6 @@ require('packer').startup(function() } } use { 'L3MON4D3/LuaSnip', - config = function() - local snippet_path = os.getenv("HOME") .. "/.config/nvim/snippets/" - if not vim.tbl_contains(vim.opt.rtp:get(), snippet_path) then - vim.opt.rtp:append(snippet_path) - end - - require("luasnip").config.set_config({ - history = true, - updateevents = "TextChanged,TextChangedI", - delete_check_events = "TextChanged,InsertLeave", - }) - require("luasnip.loaders.from_lua").lazy_load() - require("luasnip.loaders.from_vscode").lazy_load() - require("luasnip.loaders.from_snipmate").lazy_load() - end, requires = { { "rafamadriz/friendly-snippets" }, { 'saadparwaiz1/cmp_luasnip' }, diff --git a/dotfiles/.config/nvim/lua/plugins/luasnip_config.lua b/dotfiles/.config/nvim/lua/plugins/luasnip_config.lua index af161b1..11c1f79 100644 --- a/dotfiles/.config/nvim/lua/plugins/luasnip_config.lua +++ b/dotfiles/.config/nvim/lua/plugins/luasnip_config.lua @@ -10,3 +10,18 @@ vim.keymap.set({ "i", "s" }, "", function() luasnip.change_choice(1) end end, { silent = true }) + +local snippet_path = os.getenv("HOME") .. "/.config/nvim/snippets/" +if not vim.tbl_contains(vim.opt.rtp:get(), snippet_path) then + vim.opt.rtp:append(snippet_path) +end + +luasnip.config.set_config({ + history = true, + updateevents = "TextChanged,TextChangedI", + delete_check_events = "TextChanged,InsertLeave", +}) + +require("luasnip.loaders.from_lua").lazy_load() +require("luasnip.loaders.from_vscode").lazy_load() +require("luasnip.loaders.from_snipmate").lazy_load()