Skip to content

Add psmux-vim-navigator plugin (port of vim-tmux-navigator) #1

@gtbuchanan

Description

@gtbuchanan

Summary

Port vim-tmux-navigator as a psmux plugin. vim-tmux-navigator enables seamless Ctrl+h/j/k/l navigation between Vim splits and tmux panes without a prefix key, by detecting whether the active pane is running Vim.

Motivation

psmux-pain-control provides Prefix + h/j/k/l pane navigation, but it requires the prefix key and isn't Vim-aware. vim-tmux-navigator is one of the most popular tmux plugins because it makes Vim and tmux feel like a single unified workspace.

Prior Art

marlocarlo/psmux#30 confirmed the building blocks exist in psmux:

  • bind-key -n (root table bindings without prefix)
  • if-shell (conditional execution)
  • select-pane -L/-R/-U/-D

The missing piece was Windows-native foreground process detection for if-shell. The issue noted that psmux already detects foreground processes via CreateToolhelp32Snapshot for auto-rename, so extending this to if-shell conditions is feasible.

Proposed Behavior

  • Ctrl+h — move left (Vim split or psmux pane)
  • Ctrl+j — move down
  • Ctrl+k — move up
  • Ctrl+l — move right
  • When the active pane is running Vim/Neovim, send the key to Vim instead of navigating panes
  • When at the edge of Vim splits, fall through to psmux pane navigation

Workaround

Until this plugin exists, simplified (non-Vim-aware) bindings work:

bind-key -n C-h select-pane -L
bind-key -n C-j select-pane -D
bind-key -n C-k select-pane -U
bind-key -n C-l select-pane -R

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions