Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get this working with LazyNvim #21

Open
riza-khan opened this issue Jul 22, 2024 · 2 comments
Open

Unable to get this working with LazyNvim #21

riza-khan opened this issue Jul 22, 2024 · 2 comments

Comments

@riza-khan
Copy link

Just switched to Lazyvim and can't seem to get this plugin to work as expected. Worked great on Astronvim just fine.

This is the setup:

  {
    'polarmutex/git-worktree.nvim',
    version = '^2',
    dependencies = { "nvim-lua/plenary.nvim" },
    enabled = true,
    config = function ()
      require('telescope').load_extension('git_worktree')

      vim.keymap.set( "n", "W", function ()
        require("telescope").extensions.git_worktree.git_worktrees()
      end, { desc = "Worktrees" })
  end
},

Throws this:

E5108: Error executing lua: /Users/[user]/.config/nvim/lua/plugins/core.lua:52: attempt to call field 'git_worktrees' (a nil value)
stack traceback:
/Users/[user]/.config/nvim/lua/plugins/core.lua:52: in function </Users/[user]/.config/nvim/lua/plugins/core.lua:51>

Any thoughts on how to get it working with Lazyvim?

@PhilVoel
Copy link

PhilVoel commented Jul 22, 2024

The function in the keymap should be
require("telescope").extensions.git_worktree.git_worktree()
("worktree" without the "s")

@riza-khan
Copy link
Author

riza-khan commented Jul 22, 2024

Ah it looks like there was a verbiage change in V2. Thank you.

This may warrant its own issue but now there list of worktrees is not complete and I get this warning:

[telescope] [WARN 17:23:06] /Users/[user]/.local/share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:677: Finder failed with msg: ...lazy/telescope.nvim/lua/telescope/pickers/highlights.lua:33: Invalid 'hl_group': Expected Lua string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants