Skip to content

Lazy Loading - Undotree #1031

Answered by abeldekat
Barnoux asked this question in Q&A
Sep 16, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hello @Barnoux,

The default value for Config.options.defaults.lazy is false.
Adding the keys property to the spec changes the lazy property of the plugin to true, see plugin.lua

However, your keys definition is not correct. See lazy key mappings.

If you do not need to lazy-load using the keys property of the Plugin Spec, you can define the key in the init function:

{
    "mbbill/undotree",
    init = function()
      vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
    end,
}

Best regards!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Barnoux
Comment options

@abeldekat
Comment options

Answer selected by Barnoux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants