summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoropalmay <[email protected]>2023-02-06 21:50:26 +0200
committeropalmay <[email protected]>2023-02-06 21:50:26 +0200
commit430a42d01288d9e8ead12cf8317b905a5b951cd7 (patch)
tree9b6181f048cb2b2514e807664579f4c27d53a55b
parent070565d5735432b6c5c380e87cdfaaf4a98dc12b (diff)
refactor: from cr
-rw-r--r--lua/lvim/core/luasnip.lua9
-rw-r--r--lua/lvim/plugins.lua7
2 files changed, 11 insertions, 5 deletions
diff --git a/lua/lvim/core/luasnip.lua b/lua/lvim/core/luasnip.lua
index 8dd704f6..e50e5def 100644
--- a/lua/lvim/core/luasnip.lua
+++ b/lua/lvim/core/luasnip.lua
@@ -16,10 +16,11 @@ local types = {
function M.config()
lvim.builtin.luasnip = {
+ active = true,
sources = {
friendly_snippets = true,
},
- config = {
+ opts = {
history = false,
update_events = "InsertLeave",
enable_autosnippets = false,
@@ -27,7 +28,7 @@ function M.config()
-- Show virtual text to signal when you are inside an sippets
[types.insertNode] = {
active = {
- virt_text = { { "<-- snip insert", "BufferInactiveIndex" } },
+ virt_text = { { "<-- insert", "BufferInactiveIndex" } },
},
},
-- Helps to notice when you are within a choice node
@@ -45,7 +46,7 @@ function M.setup()
local utils = require "lvim.utils"
local paths = {}
if lvim.builtin.luasnip.sources.friendly_snippets then
- paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets")
+ paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "lazy", "opt", "friendly-snippets")
end
local user_snippets = utils.join_paths(get_config_dir(), "snippets")
@@ -54,7 +55,7 @@ function M.setup()
end
local luasnip = require "luasnip"
- luasnip.config.set_config(lvim.builtin.luasnip.config)
+ luasnip.config.set_config(lvim.builtin.luasnip.opts)
-- When no paths are provided, luasnip will search in the runtimepath
require("luasnip.loaders.from_lua").lazy_load()
diff --git a/lua/lvim/plugins.lua b/lua/lvim/plugins.lua
index c3064f5c..5fe7211e 100644
--- a/lua/lvim/plugins.lua
+++ b/lua/lvim/plugins.lua
@@ -65,10 +65,14 @@ local core_plugins = {
},
},
{ "hrsh7th/cmp-nvim-lsp", lazy = true },
- { "saadparwaiz1/cmp_luasnip", lazy = true },
{ "hrsh7th/cmp-buffer", lazy = true },
{ "hrsh7th/cmp-path", lazy = true },
{
+ "saadparwaiz1/cmp_luasnip",
+ lazy = true,
+ enabled = lvim.builtin.luasnip.active,
+ },
+ {
"hrsh7th/cmp-cmdline",
lazy = true,
enabled = lvim.builtin.cmp and lvim.builtin.cmp.cmdline.enable or false,
@@ -82,6 +86,7 @@ local core_plugins = {
dependencies = {
"friendly-snippets",
},
+ enabled = lvim.builtin.luasnip.active,
},
{ "rafamadriz/friendly-snippets", lazy = true, cond = lvim.builtin.luasnip.sources.friendly_snippets },
{