[Help needed] Some beginner's questions about "optional plugin" #823
-
I'm new to the Lua configuration and also new to the packer. I'm trying to get myself familiar with the mechanism by studying an exist configuration of someone else. I run some test on my downloaded configuration and tried disable one plugin (I use a plugin called "which-key.nvim" for testing) by comment the deceleration; add the opt=true, remove the opt=true by comment the line; and I received some unexpected results. All seems fine when I disabled the plugin, it cause errors says the plugin is missing when I try to use it. The plugin still function while I have opt=true, but it is marked as (not loaded) in PackerStatus The plugin functions the same while I commented opt=true and it is no longer been marked as (not loaded) And I have took a look at the log file which located at $HOME/.cache/nvim/packer.nvim.log, and it only have one line of WARN says another irrelevant potential breaking change in one commit, which seems not relevant to my question. Please provide me with some suggestion about what I should do to pinpoint more useful information that helpful for understanding the question, or what I have missed to look at. I would really appreciated if anyone could read through my questions and provide some help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Welcome! You should almost never need to mark a plugin as
Note that if you change the type of a plugin, you need to run You may also want to read |
Beta Was this translation helpful? Give feedback.
Welcome!
You should almost never need to mark a plugin as
opt
manually.packer
will not load manuallyopt
plugins; if you want them enabled, you have topackadd
them yourself. The main reason that people do this is if they want some custom loading logic thatpacker
doesn't support.packer
will implicitly make pluginsopt
if they use lazy-loading features. This is done to prevent them from being loaded until the lazy-load condition triggers. You do not need to manually mark a pluginopt
to do this; just use one of the lazy-loading keywords in the plugin's specification.Note that if you change the type of a plugin, you need to run
PackerUpdate
/PackerSync
to move it to the correct directory…