mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-30 06:39:33 +02:00
feat(cmp): add option to disable friendly-snippets (#2660)
authored-by: Emerson Max de Medeiros Silva <emersonmx@gmail.com>
This commit is contained in:
parent
a11c46c29a
commit
7220f1f204
2 changed files with 11 additions and 4 deletions
|
@ -40,6 +40,12 @@ function M:init()
|
||||||
custom_section = {},
|
custom_section = {},
|
||||||
footer = {},
|
footer = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lvim.builtin.luasnip = {
|
||||||
|
sources = {
|
||||||
|
friendly_snippets = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
local function handle_deprecated_settings()
|
local function handle_deprecated_settings()
|
||||||
|
|
|
@ -58,19 +58,20 @@ local core_plugins = {
|
||||||
end,
|
end,
|
||||||
requires = {
|
requires = {
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
"rafamadriz/friendly-snippets",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
|
disable = not lvim.builtin.luasnip.sources.friendly_snippets,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
config = function()
|
config = function()
|
||||||
local utils = require "lvim.utils"
|
local utils = require "lvim.utils"
|
||||||
local paths = {
|
local paths = {}
|
||||||
utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets"),
|
if lvim.builtin.luasnip.sources.friendly_snippets then
|
||||||
}
|
paths[#paths + 1] = utils.join_paths(get_runtime_dir(), "site", "pack", "packer", "start", "friendly-snippets")
|
||||||
|
end
|
||||||
local user_snippets = utils.join_paths(get_config_dir(), "snippets")
|
local user_snippets = utils.join_paths(get_config_dir(), "snippets")
|
||||||
if utils.is_directory(user_snippets) then
|
if utils.is_directory(user_snippets) then
|
||||||
paths[#paths + 1] = user_snippets
|
paths[#paths + 1] = user_snippets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue