Skip to content

Template configuration fails with lazy.nvim #25

@ChausseBenjamin

Description

@ChausseBenjamin

I tried porting your configuration to the lazy.nvim package manager. This is what I got:

return {
  "lmburns/lf.nvim",
  dependencies = {
    {
      "akinsho/toggleterm.nvim",
      version = "*",
      config = true, -- Runs require("toggleterm").setup()
    },
  },
  config = function()
    vim.g.lf_netrw = 1
    require("lf").setup()
    vim.api.nvim_create_autocmd({
      event = "User",
      pattern = "LfTermEnter",
      callback = function(a)
        vim.api.nvim_buf_set_keymap(a.buf, "t", "q", "q", { nowait = true })
      end,
    })
  end,
}

The one bit that seems to be having issues is the autocmd. Without it, nvim launches fine (but lf doesn't seem to work). With it, nvim gives me the following error at launch:

Failed to run `config` for lf.nvim

/home/master/.config/nvim/lua/ben/plugins/lf.lua:13: Expected 2 arguments

# stacktrace:
  - lua/ben/plugins/lf.lua:13 _in_ **config**
  - lua/ben/lazy.lua:13
  - init.lua:2
Press ENTER or type command to continue

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