kdheepak / lazygit.nvim

Plugin for calling lazygit from within neovim.
MIT License
1.47k stars 53 forks source link

Error in README.md Lazy.nvim installation code #128

Open mm-crj opened 5 months ago

mm-crj commented 5 months ago

Description In the code for Lazy.nvim installation, the setup function must be inside the table. At least, this what worked for me.

  {
    "kdheepak/lazygit.nvim",
    cmd = {
      "LazyGit",
      "LazyGitConfig",
      "LazyGitCurrentFile",
      "LazyGitFilter",
      "LazyGitFilterCurrentFile",
    },
    config = function()
      require("lazy").setup({})
    end,
    -- optional for floating window border decoration
    dependencies = {
      "nvim-lua/plenary.nvim",
    },
    -- setting the keybinding for LazyGit with 'keys' is recommended in
    -- order to load the plugin when the command is run for the first time
    keys = {
      { "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
    }
  },

lazy = false also should work instead of the keybind. Desktop (please complete the following information):

- nvim --version: NVIM v0.9.4 Build type: RelWithDebInfo LuaJIT 2.1.1692716794 :checkhealth OS Info: { machine = "x86_64", release = "6.5.0-28-generic", sysname = "Linux", version = "#29~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 4 14:39:20 UTC 2" }

avree commented 4 months ago

I had the same issue with readme installation.

return { "kdheepak/lazygit.nvim", cmd = { "LazyGit", "LazyGitConfig", "LazyGitCurrentFile", "LazyGitFilter", "LazyGitFilterCurrentFile" }, dependencies = { "nvim-lua/plenary.nvim" }, keys = { { "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" } } }

This resolved it.