Skip to content

sunaku/tmux-navigate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

tmux-navigate

Intelligently navigate tmux panes and Vim splits using the same keys. This also supports SSH tunnels where Vim is running on a remote host.

inside Vim? is Zoomed? Action taken by key binding
No No Focus directional tmux pane
No Yes Nothing: ignore key binding
Yes No Seamlessly focus Vim / tmux
Yes Yes Focus directional Vim split

See https://sunaku.github.io/tmux-select-pane.html for documentation.

Installation

  1. Install the TPM framework for tmux.
  1. Add this line to your ~/.tmux.conf:
set -g @plugin 'sunaku/tmux-navigate'
  1. Configure your navigation shortcuts:
# if you're using QWERTY layout
set -g @navigate-left  '-n M-h'
set -g @navigate-down  '-n M-j'
set -g @navigate-up    '-n M-k'
set -g @navigate-right '-n M-l'
set -g @navigate-back  '-n M-\'

# if you're using DVORAK layout
set -g @navigate-back  '-n M-d'
set -g @navigate-left  '-n M-h'
set -g @navigate-up    '-n M-t'
set -g @navigate-down  '-n M-n'
set -g @navigate-right '-n M-s'
  1. Reload your tmux configuration file.

  2. Type prefix+I. (This makes TPM install the plugin.)

Vim integration

Option 1: use your favorite Vim plugin manager

Plug 'sunaku/tmux-navigate'

Option 2: symlink from your tmux plugins clone

mkdir -p ~/.vim/plugin/
ln -s ~/.tmux/plugins/tmux-navigate/plugin/tmux-navigate.vim ~/.vim/plugin/

License

Like my work? πŸ‘ Please spare a life today as thanks! πŸ„πŸ–πŸ‘πŸ”πŸ£πŸŸβœ¨πŸ™ŠβœŒ
Why? For πŸ’• ethics, the 🌎 environment, and πŸ’ͺ health; see link above. πŸ™‡

(the ISC license)

Copyright 2018 Suraj N. Kurapati https://github.com/sunaku

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.