Skip to content

Lazy loading with lazy.nvim

dcampos edited this page Aug 12, 2024 · 10 revisions

It is possible to load nvim-snippy lazily with lazy.nvim. The config below loads Snippy based on keybindings, filetypes and commands. If you use different mappings, change the keys parameter accordingly.

{
    'dcampos/nvim-snippy',
    keys = {
        { '<Tab>', mode = { 'i', 'x' } },
        'g<Tab>',
    },
    ft = 'snippets',
    cmd = { 'SnippyEdit', 'SnippyReload' },
    opts = {
        -- Put your `setup()` parameters here if needed.
        -- Snippy doesn't require any configuration or setup by default,
        -- so you can remove this `opts = {}` part entirely.
    }
}

Note that lazy loading Snippy shouldn't normally be necessary, as it already tries to lazily load itself as much as possible.

Clone this wiki locally