Skip to content

[Help needed] Some beginner's questions about "optional plugin" #822

@hypghzy

Description

@hypghzy

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 failed to understand the reasoning of mark "opt", why should some one mark a plugin as optional, how does the packer decided load an optional plugin or not?

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions