Use vim motions and natively manage your socks.
A Neovim session manager and lightweight multiplexer written in Go.
v runs as the foreground process of a single terminal window. It acts as an interactive picker for Neovim sessions, attaches the chosen server using nvim --server SOCK --remote-ui, and seamlessly returns to the picker whenever the client exits.
Because servers run headless and detached, closing your terminal window loses zero state.
Installs v into $PREFIX/bin (default /usr/local):
make installnvimandfzfavailable on your$PATH.stty(used to safely save and restore terminal states).
The hub relies on your Neovim configuration to handle detaching gracefully. Ensure your init.lua maps <leader>d and terminal-mode <C-\><C-d> to :detach:
vim.keymap.set('n', '<leader>d', ':detach<CR>', { silent = true })
vim.keymap.set('t', '<C-\\><C-d>', '<C-\\><C-n>:detach<CR>', { silent = true })When the client detaches or the server quits, the hub automatically redisplays the session picker.
| Command | Effect |
|---|---|
v |
Open hub (all rows: live + dormant repos) |
v -j, v --jump |
Same as v |
v -a, v --attach |
Open hub (live rows only) |
v -l, v --list |
Print session table (--json for JSON output) |
v -k, v --kill |
Interactive multi-select to force-quit sessions |
v -n NAME |
Create new session (project or project.role) |
v -p P / v -r R |
Specify project / role for a new session |
v --load PATTERN [DIR] |
New session with up to 40 matching files |
v [DIR] |
New session started in DIR |
v [FILES...] |
New session with files (or open inside current nvim instance) |
v -t X |
Inside nvim: send files to session X |
v --mv NAME TARGET |
Move a session to a new project or role |
v --detached |
Create session without attaching, print socket path |
v --startuptime |
Pass --startuptime to the new server |
v -h, v --help |
Show usage information |
All operational data lives under ${XDG_STATE_HOME:-$HOME/.local/state}/v:
sockets/— Active UNIX domain socketslogs/— Server logs and debugging outputmru— Most recently used tracking
Design Decisions (Click to expand)
- Sanitization: Sanitization does not append trailing underscores (
_). The original bash implementation used a here-string that turned trailing newlines into_. Go'sproj.Sanitize("main")cleanly returnsmain(though legacy sockets ending in_remain fully compatible). - Socket Safety & Probing: Managed sockets are probed directly. Unmanaged sockets are probed only when
/procconfirms an activenvimprocess owns them, ensuringvnever accidentally connects to an alien socket. - Stale Socket Cleanup: Automatically purged during discovery (managed paths) and during spawn attempts if a probe returns connection refused or
ENOENT. - Implicit Naming: Omitting
-n/-p/-rautomatically walks increments (project-2,project-3, etc.) until a free path is found. Explicit name collisions return a clear error:session 'NAME' already exists (SOCK). - fzf Key Bindings: Binds
--expect=ctrl-x,ctrl-n,alt-m(bare Enter is empty). Esc andCtrl-Ccancel cleanly with exit code0from the hub. - Signal Forwarding: The hub intercepts
SIGINT/SIGQUITand suppresses them while a child process runs usingsignal.Notify.SIGHUP/SIGTERMare correctly forwarded to the child. - Fast-Fail Guard: Three consecutive rapid client exits within
FastFailWindowtriggerclient exited immediately; is the server alive?and exit with status1. - Pattern Matching (
--load): Treats patterns without/as basenames and fully supports**glob segments. - Dormant Discovery: Seamlessly recognizes
.gitas either a traditional directory or a git worktree file. - Timeouts: Configured for
config.ProbeTimeout(150 ms),config.SpawnTimeout(3 s), andconfig.KillGrace(2 s) per termination stage.
Distributed under the MIT License. See LICENSE for more information.
