-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: don't add the disabled plugins to plugins list. #1079
Conversation
Signed-off-by: ayamir <[email protected]>
It works, thanks. By the way, I noticed that all the user plugins' config are stored in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ayamir @CharlesChiuGit Let's say I don't use editor["nvim-treesitter/nvim-treesitter"] = {
lazy = true,
build = function()
if #vim.api.nvim_list_uis() ~= 0 then
vim.api.nvim_command([[TSUpdate]])
end
end,
event = "BufReadPre",
config = require("editor.treesitter"),
dependencies = {
{" anuvyklack/pretty-fold.nvim" },
{ "andymass/vim-matchup" },
{ "mfussenegger/nvim-treehopper" },
{ "nvim-treesitter/nvim-treesitter-textobjects" },
{
"abecodes/tabout.nvim",
config = require("editor.tabout"),
},
{
"windwp/nvim-ts-autotag",
config = require("editor.autotag"),
},
{
"NvChad/nvim-colorizer.lua",
config = require("editor.colorizer"),
},
{
"hiphish/rainbow-delimiters.nvim",
config = require("editor.rainbow_delims"),
},
{
"nvim-treesitter/nvim-treesitter-context",
config = require("editor.ts-context"),
},
{
"JoosepAlviste/nvim-ts-context-commentstring",
config = require("editor.ts-context-commentstring"),
},
},
} and set |
Signed-off-by: ayamir <[email protected]>
@YuCao16 It will remove plugins in dependenices now. |
It can be done in another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I'm a bit opposed to this PR b/c it not only adds a layer of complexity, but also addresses only one potential "edge use case". This is why folke said in this issue that he won't support including two plugins with the same (plugin) name but different repo names in the spec at the same time. Instead, he suggested that ppl should use the dev
(or url
) option, e.g.:
completion["nvimdev/lspsaga.nvim"] = {
url = "https://example.com/path/to/ur/lspsaga.nvim.git",
-- other configs
}
I think we already support this now: editor["m4xshen/autoclose.nvim"] = {
lazy = true,
event = "InsertEnter",
config = require("configs.editor.autoclose"), -- will require user/configs/editor/autoclose.lua
}
Because editor["nvim-treesitter/nvim-treesitter"] = {
dependencies = {
{ "anuvyklack/pretty-fold.nvim" },
{ "andymass/vim-matchup", enabled = false },
},
} |
But seems it requires users to change repo's config. And I think we should keep our API for users works correctly for all of use cases. |
I just checked the implementation of local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
-- add any other pugins here
{ "nvimdev/lspsaga.nvim" },
{ "ayamir/lspsaga.nvim", opts = {} },
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.opt.termguicolors = true
vim.cmd([[colorscheme tokyonight]]) Save it as ● lspsaga.nvim 12.42ms ▷ start
dir /private/var/folders/jy/91xg_8j9169dydct2k4r7yw80000gn/T/tmp.chC1vsz66n/.repro/plugins/lspsaga.nvim
url https://github.com/ayamir/lspsaga.nvim
^^^^^^
branch main
commit d3dfaea
readme README.md
help |lspsaga.nvim.txt| So IMO our loader has indeed done what it was supposed to do. The only thing missing here is we need to document this particular use case in the wiki - if users want to use their own fork(s) to overwrite the default one(s), they don’t need to include the base plugin(s) in |
#1077
@Jint-lzxy @CharlesChiuGit @YuCao16