Skip to content
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

Remove importing Extras from the example #52

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

istepic
Copy link

@istepic istepic commented Feb 18, 2024

Importing Extras from plugins/ folder can have consequences on the configuration of the plugin that's enabled in the Extras. lazy.nvim loads plugins alphabetically from plugins/ folder which can mean that some plugins will have configuration based on the order in which they are loaded. When configuration options are getting merged this has no effect. But when configuration option is supposed to get completely replaced this can be a problem. For more details see LazyVim/LazyVim/issues/2567.

Extras documentation recommends using :LazyExtras command or importing extras in config/lazy.lua. Example should be consistent with that recommendation.

Importing Extras from plugins/ folder can have consequences on the
configuration of the plugin that's enabled in the Extras. lazy.nvim
loads plugins alphabetically from plugins/ folder which can mean
that some plugins will have configuration based on the order in
which they are loaded. When configuration options are getting merged
this has no effect. But when configuration option is supposed to
get completely replaced this can be a problem. For more details see
LazyVim/LazyVim/issues/2567.

Extras documentation recommends using :LazyExtras command or importing
extras in config/lazy.lua. Example should be consistent with that
recommendation.
@testfailed
Copy link

I prefer to the config file form to setting extras options and I got to know it from the comment on the example.lua. I think removing the instruction from the example could make people like me more hard to use of it or even forcing them to use menu options not knowing about config file usage.

Maybe could it be solved by syncing extras options on a some kind of auto-generated config file?

e.g.

lua/
|- config/
|  |- ...
|  |- lazy.lua
|  |- _extras.lua <--- it's auto-generated and synced with extras options on the setting.
|- plugins/
   |- ...

and in lua/config/_extras.lua

-- lua/config/_extras.lua
-- (Some warning/instruction messages like below)

-- IT'S AUTO-GENERATED FILE!
-- It would be automatically updated on toggling extras options on the setting.
-- Commented line means it is DISABLED and you can uncomment it to set it ENABLED.
-- Your changes here will also applied to the extras setting.
-- Refer to the link for a full list of manual: https://www.lazyvim.org/extras

-- Sorry about awkward example below. I'm new to lua and lazyvim. 
require("lazy").extend_setup({
  spec = {
    -- { import = "lazyvim.plugins.extras.coding.codeium" }, -- Commented means DISABLED
    { import = "lazyvim.plugins.extras.coding.copilot" },    -- Uncommented means ENABLED
    { import = "lazyvim.plugins.extras.coding.native_snippets" },
    -- { import = "lazyvim.plugins.extras.coding.tabnine" },
    { import = "lazyvim.plugins.extras.coding.yanky" },
    { import = "lazyvim.plugins.extras.dap.core" },
    { import = "lazyvim.plugins.extras.dap.nlua" },
    { import = "lazyvim.plugins.extras.editor.aerial" },
    -- { import = "lazyvim.plugins.extras.editor.leap" },
    -- { import = "lazyvim.plugins.extras.editor.mini-files" },
    { import = "lazyvim.plugins.extras.editor.symbols-outline" },
    { import = "lazyvim.plugins.extras.editor.navic" },
    { import = "lazyvim.plugins.extras.formatting.black" },
    { import = "lazyvim.plugins.extras.formatting.prettier" },
    -- ...
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants