worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

[Feature request] nvim plugin and default titles

Open willbowdler-cc opened this issue 8 months ago • 4 comments

This seems like a really great library. I work exclusively in nvim and tmux. I would be great if there was a seemless plugin that I could integrate with snacks in nvim (I'm sure other users would like a telescope integration).

Also, it would be great if there was the ability to have a hard-coded name for a worktree with worktrunk. I would like to be able to have a worktree called reviews where I checkout reviews prs. main, where I just checkout random things I am working on. <feature> where I am working on a feature that will be multiple prs, and with worktrunk be able to do wt switch reviews/main/<feature>. It doesn't seem like this workflow is possible yet in worktrunk

willbowdler-cc avatar Mar 13 '26 20:03 willbowdler-cc

neovim seems to really be lacking when it comes to good worktree plugins. ThePrimeagen created one, but it hasn't been touched in 4 years

willbowdler-cc avatar Mar 13 '26 20:03 willbowdler-cc

Thanks for the suggestion and the kind words about the project!

I searched the codebase and neither feature exists today. Here's what's closest:

Editor integration: There's no dedicated nvim/telescope plugin, but wt switch has an --execute / -x flag that runs a command after switching, which could be used to launch nvim in the new worktree:

wt switch -x 'nvim {{ worktree_path }}' feature

There are also examples in the tips & patterns docs for tmux and VS Code integration using this mechanism. A telescope extension that calls wt list --format=json and wt switch under the hood would be a natural fit, but nothing like that exists yet.

Named/fixed worktrees: Worktrees are currently addressed exclusively by branch name (with shortcuts like ^ for default branch, - for previous, and pr:123 for PRs). There's no concept of a persistent alias like reviews that maps to whatever branch you last checked out there. The closest related request is #1130 (reusable slot numbers).

I'll leave it for a maintainer to evaluate and prioritize both ideas.

worktrunk-bot avatar Mar 13 '26 20:03 worktrunk-bot

I would be happy to see this!

given I don't use nvim, my mental model is that someone who does use nvim would make it

I'm happy to make any adjustments on the worktrunk binary side to be helpful


on the fixed worktree front: Worktrunk does take an opinion on having a mapping between branches and worktrees, and the bar would be extremely high to have an API which required that to be violated (wt step promote is an example of this)

but probably someone could design something with Aliases to make this work...

max-sixty avatar Mar 13 '26 21:03 max-sixty

Thank you for the feedback 🙏

willbowdler-cc avatar Mar 13 '26 21:03 willbowdler-cc