mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 08:35:53 +02:00
fix(extras): disable import handling when loading :LazyExtras
+ changed some recommendations
This commit is contained in:
parent
66981fe5b2
commit
121a2e27ef
5 changed files with 23 additions and 23 deletions
|
@ -4,7 +4,6 @@
|
||||||
-- and more.
|
-- and more.
|
||||||
return {
|
return {
|
||||||
"echasnovski/mini.surround",
|
"echasnovski/mini.surround",
|
||||||
recommended = true,
|
|
||||||
keys = function(_, keys)
|
keys = function(_, keys)
|
||||||
-- Populate the keys based on the user's options
|
-- Populate the keys based on the user's options
|
||||||
local opts = LazyVim.opts("mini.surround")
|
local opts = LazyVim.opts("mini.surround")
|
||||||
|
|
|
@ -40,7 +40,6 @@ end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
desc = "Awesome picker for FZF (alternative to Telescope)",
|
desc = "Awesome picker for FZF (alternative to Telescope)",
|
||||||
recommended = true,
|
|
||||||
{
|
{
|
||||||
"ibhagwan/fzf-lua",
|
"ibhagwan/fzf-lua",
|
||||||
cmd = "FzfLua",
|
cmd = "FzfLua",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
return {
|
return {
|
||||||
{
|
desc = "Snacks File Explorer",
|
||||||
|
recommended = true,
|
||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
opts = { explorer = {} },
|
opts = { explorer = {} },
|
||||||
keys = {
|
keys = {
|
||||||
|
@ -20,5 +21,4 @@ return {
|
||||||
{ "<leader>e", "<leader>fe", desc = "Explorer Snacks (root dir)", remap = true },
|
{ "<leader>e", "<leader>fe", desc = "Explorer Snacks (root dir)", remap = true },
|
||||||
{ "<leader>E", "<leader>fE", desc = "Explorer Snacks (cwd)", remap = true },
|
{ "<leader>E", "<leader>fE", desc = "Explorer Snacks (cwd)", remap = true },
|
||||||
},
|
},
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ end
|
||||||
---@param modname string
|
---@param modname string
|
||||||
---@param source LazyExtraSource
|
---@param source LazyExtraSource
|
||||||
function M.get_extra(source, modname)
|
function M.get_extra(source, modname)
|
||||||
|
LazyVim.plugin.handle_defaults = false
|
||||||
local enabled = vim.tbl_contains(M.state, modname)
|
local enabled = vim.tbl_contains(M.state, modname)
|
||||||
local spec = Plugin.Spec.new(nil, { optional = true, pkg = false })
|
local spec = Plugin.Spec.new(nil, { optional = true, pkg = false })
|
||||||
spec:parse({ import = modname })
|
spec:parse({ import = modname })
|
||||||
|
|
|
@ -5,6 +5,7 @@ local M = {}
|
||||||
|
|
||||||
---@type string[]
|
---@type string[]
|
||||||
M.core_imports = {}
|
M.core_imports = {}
|
||||||
|
M.handle_defaults = true
|
||||||
|
|
||||||
M.lazy_file_events = { "BufReadPost", "BufNewFile", "BufWritePre" }
|
M.lazy_file_events = { "BufReadPost", "BufNewFile", "BufWritePre" }
|
||||||
|
|
||||||
|
@ -81,7 +82,7 @@ end
|
||||||
function M.fix_imports()
|
function M.fix_imports()
|
||||||
local defaults ---@type table<string, LazyVimDefault>
|
local defaults ---@type table<string, LazyVimDefault>
|
||||||
Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec)
|
Plugin.Spec.import = LazyVim.inject.args(Plugin.Spec.import, function(_, spec)
|
||||||
if LazyVim.config.json.loaded then
|
if M.handle_defaults and LazyVim.config.json.loaded then
|
||||||
-- extra disabled by defaults?
|
-- extra disabled by defaults?
|
||||||
defaults = defaults or LazyVim.config.get_defaults()
|
defaults = defaults or LazyVim.config.get_defaults()
|
||||||
local def = defaults[spec.import]
|
local def = defaults[spec.import]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue