neovim: move luasnip config back to it's module
This commit is contained in:
parent
384d023ead
commit
8e63b0f857
2 changed files with 15 additions and 15 deletions
|
@ -24,21 +24,6 @@ require('packer').startup(function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
use { 'L3MON4D3/LuaSnip',
|
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 = {
|
requires = {
|
||||||
{ "rafamadriz/friendly-snippets" },
|
{ "rafamadriz/friendly-snippets" },
|
||||||
{ 'saadparwaiz1/cmp_luasnip' },
|
{ 'saadparwaiz1/cmp_luasnip' },
|
||||||
|
|
|
@ -10,3 +10,18 @@ vim.keymap.set({ "i", "s" }, "<C-E>", function()
|
||||||
luasnip.change_choice(1)
|
luasnip.change_choice(1)
|
||||||
end
|
end
|
||||||
end, { silent = true })
|
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()
|
||||||
|
|
Loading…
Reference in a new issue