kdheepak / lazygit.nvim

Plugin for calling lazygit from within neovim.
MIT License
1.51k stars 56 forks source link

Switching to selected worktree directory #137

Open voylin opened 2 months ago

voylin commented 2 months ago

Is your feature request related to a problem? Please describe.

I recently started working with worktrees but when opening LazyVim inside of nvim and go to the worktree section, there is no way to change the current nvim work directory to the one selected. You can press o to open the editor, but then you have a vim instance inside of the lazygit window.

Describe the solution you'd like

When switching to a worktree, it would be nice if the nvim instance would switch to the worktree folder. I do not know in how far this would be possible though and it's not a big issue, it could just save time being able to do it directly inside of lazygit.

zyriab commented 1 day ago

Would love this feature! For reference, here's how you can do this with the standalone tool. It works when selecting a repo as well as when changing worktrees.

https://github.com/jesseduffield/lazygit?tab=readme-ov-file#changing-directory-on-exit