Skip to content

sindrip/tmux-nvim-navigator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmux-nvim-navigator

CI License: MIT

Navigate between tmux panes and Neovim splits with Ctrl-h/j/k/l. Pure tmux — no Neovim plugin or config needed.

demo

Works with any Neovim config, including --clean and multiple NVIM_APPNAME setups. When entering a Neovim pane, the cursor is repositioned to the nearest split on the side you came from.

Requirements

  • tmux >= 3.0
  • Neovim >= 0.8

Installation

TPM (recommended)

Add the plugin to your tmux.conf:

set -g @plugin 'sindrip/tmux-nvim-navigator'

To customize the keybindings, set these options before the plugin line:

set -g @tmux-nvim-navigator-left  'C-h'
set -g @tmux-nvim-navigator-down  'C-j'
set -g @tmux-nvim-navigator-up    'C-k'
set -g @tmux-nvim-navigator-right 'C-l'

Manual

Add these to your tmux.conf:

bind -n C-h run-shell "/path/to/bin/tmux-navigate left"
bind -n C-j run-shell "/path/to/bin/tmux-navigate down"
bind -n C-k run-shell "/path/to/bin/tmux-navigate up"
bind -n C-l run-shell "/path/to/bin/tmux-navigate right"

How it works

When you navigate in a direction:

  1. If the current pane is running Neovim, the plugin tries to move within Neovim's splits
  2. If the cursor is already at the edge of Neovim's splits (or the pane isn't running Neovim), it moves to the next tmux pane
  3. When entering a Neovim pane, the cursor is repositioned to the nearest split on the side you came from

All of this is handled entirely on the tmux side via Neovim's --remote-expr RPC interface over the Unix socket. Your Neovim config stays completely untouched.

Alternatives

Other plugins require configuration for both programs:

Plugin Neovim plugin required? tmux config required?
tmux-nvim-navigator No Yes
vim-tmux-navigator Yes Yes
smart-splits.nvim Yes Yes
nvim-tmux-navigation Yes Yes

About

Navigate between tmux panes and Neovim splits, no Neovim plugins or config required

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages