Question

I'm using tmux and vim and I want to navigate between panes easily. I want to use Ctrl+h/j/k/l to switch between panes. I have this in my .vimrc :

Bundle 'christoomey/vim-tmux-navigator'
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l

And I have this in my .tmux.conf

bind -n C-h run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"

It works to switch between tmux's panels but it does not works inside vim. What can I do to make it working inside vim?

Was it helpful?

Solution

Finaly, I make it work by upgrading tmux to the latest version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top