folke / twilight.nvim

🌅 Twilight is a Lua plugin for Neovim 0.5 that dims inactive portions of the code you're editing using TreeSitter.
Apache License 2.0
1.24k stars 21 forks source link

ask: How to run twilight in lazy? #38

Closed tendertree closed 5 months ago

tendertree commented 5 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.5

Operating system/version

archlinux(wsl2)

Describe the bug

screen

I try to use twilight in lazy. So I configured my lazy plugin config to add key option to call the Twlight

my expectation twilihgt not loaded until I press the T but when I press the T

it say Not an editor command :Twilight

is there a way to load correctly ?

or should I use Event ? I

Steps To Reproduce

  1. add key option in tiwlihgt.nvim in lazy config
  2. press key to call : Twilight

Expected Behavior

lazy load work when I press T key which I set the lazy config

Repro

{
        "folke/twilight.nvim",
        config = function()
            require("twilight").setup {}
        end,
        dependencies = {
            {
                {
                    "folke/zen-mode.nvim",
                    config = function()
                        require("zen-mode").setup {}
                    end
                },
            }
        },
        keys = {
            { 'T', ":Twilight<CR>", noremap = true, silent = true, }
        }
    },