/evil-tmux-navigator

Seamlessly navigate Emacs and tmux splits

Primary LanguageEmacs LispDo What The F*ck You Want To Public LicenseWTFPL

evil-tmux-navigator

A fork of a fork of a port of vim-tmux-navigator. The code is identical to the upstream fork (unless I've let it get out of date); I just corrected errors in the README.

This is meant to work with evil which gives you vim bindings in emacs.

Install it with something like

(straight-use-package
  '(evil-tmux-navigator :type git :host github :repo "ambirdsall/evil-tmux-navigator"))

or however you'd like, and make sure to make some keybindings for it. I use doom, so:

(use-package evil-tmux-navigator)
  :config
  (evil-tmux-navigator-bind-keys))

You also have to setup commands in your ~/.tmux.conf:

bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$|emacs.*$' && tmux send-keys C-l) || tmux select-pane -R"

Troubleshooting

Good luck!