kkoomen / vim-doge

(Do)cumentation (Ge)nerator for nearly 20 languages 📚 Generate proper code documentation with a single keypress. ⚡️🔥
GNU General Public License v3.0
1.01k stars 51 forks source link

keymaps in lazyvim ? #642

Closed Luxni closed 1 year ago

Luxni commented 1 year ago

install use lazyvim :

return {
    "kkoomen/vim-doge",
    keys = {
        {
            "<leader>cp",
            function()
                vim.api.nvim_command("DogeGenerate")
            end,
            { desc = "doge generate" },
        },
     },
}

when call the 'DogeGenerate'

E5108: Error executing lua: /Users/lux/.config/nvim/lua/plugins/vim-doge.lua:7: function doge#generate, line 2: Vim(echoerr):[vim-doge] It seems like you forgot to set `filetype plugin on` in your .vimrc
stack traceback:
    [C]: in function 'nvim_command'
    /Users/lux/.config/nvim/lua/plugins/vim-doge.lua:7: in function </Users/lux/.config/nvim/lua/plugins/vim-doge.lua:6>

but when you comment keys code is working:

return {
    "kkoomen/vim-doge",
    -- keys = {
    --   {
    --    "<leader>cp",
    --    function()
    --      vim.api.nvim_command("DogeGenerate")
    --    end,
    --    { desc = "doge generate" },
    --   },
    -- },
}

what's wrong with me?

kkoomen commented 1 year ago

It seems like you forgot to set filetype plugin on in your .vimrc

The error message is clear here in what you should do.

ElonH commented 7 months ago

It seems like you forgot to set filetype plugin on in your .vimrc

The error message is clear here in what you should do.

It not working.

Plugins will be lazy-loaded, when It has keys key.

https://github.com/folke/lazy.nvim?tab=readme-ov-file#lazy-loading

so I set the key lazy = false, It's working when keys exists.

doge has some problems on lazy-loaded.