Skip to content

Add worktree switching + master diff workflow - #322

Merged
stanfish06 merged 1 commit into
masterfrom
claude/neovim-worktree-workflow-9de056
Aug 12, 2026
Merged

Add worktree switching + master diff workflow#322
stanfish06 merged 1 commit into
masterfrom
claude/neovim-worktree-workflow-9de056

Conversation

@stanfish06

Copy link
Copy Markdown
Owner

Summary

  • Adds lua/config/worktree.lua, a small self-contained module (same style as lua/config/filetree.lua) for working with git worktrees from inside a running session, no new plugin dependency (uses the existing fzf-lua, falls back to vim.ui.select).
  • :Worktrees / <leader>sw — lists worktrees (via git worktree list --porcelain) in a picker. <CR> opens the selected worktree in a new tab (:tcd), <C-x> switches the current tab in place, <C-y> copies the path.
  • :WorktreeDiff [ref] / <leader>gm — diffs the current worktree's working tree against master/main (auto-detected, or an explicit ref) via the already-installed diffview.nvim.
  • Registered in init.lua's module list under the extra tier, alongside config.filetree/config.server.

Test plan

  • :SyncPkgs then restart, confirm no errors in :ConfigHealth
  • From a repo with multiple worktrees, :Worktrees lists them; <CR> opens a new tab rooted at the selected worktree
  • <leader>gm opens a diffview against master/main from within a worktree
  • Without fzf-lua loaded, :Worktrees falls back to vim.ui.select

Generated by Claude Code

Lists worktrees via `git worktree list --porcelain` in an fzf-lua picker
(falls back to vim.ui.select), switches the session into one with :tcd
(new tab by default, current tab via ctrl-x), and adds :WorktreeDiff /
<leader>gm to diff the current worktree against master/main through
diffview.nvim.
@stanfish06
stanfish06 merged commit 329420b into master Aug 12, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants