Remove importing Extras from the example#52
Open
istepic wants to merge 1 commit into
Open
Conversation
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.
|
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. 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" },
-- ...
},
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.