christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.32k stars 329 forks source link

doesn't work when jump out from vim to tmux pane #141

Open caerlie opened 8 years ago

caerlie commented 8 years ago

doesn't work when jump out from vim to tmux pane.

this is my setting

■.tmux.conf v2.3 https://github.com/caerlie/vim-tmux-config-remote-linux/blob/master/.tmux.conf ■.vimrc v7.4 https://github.com/caerlie/vim-tmux-config-remote-linux/blob/master/.vimrc ■OS Ubuntu 12.04 LTS

■:TmuxPaneCurrentCommand when use :TmuxPaneCurrentCommand ,just return nothing tmux1tmux2

:display-message -p '#{pane_current_command}' when use [:display-message -p '#{pane_current_command}'] in tmux, it reture vim!

christoomey commented 8 years ago

Hey @caerlie, sorry to hear about the trouble. Can you answer the following questions to help me debug for you:

  1. Am I correct in understanding that you can move between splits in Vim, and panes in tmux, but not from Vim window to tmux pane? Or is all navigation in Vim failing?
  2. With Vim active in a tmux session, can you run the following commang in the tmux prompt (you can access the tmux prompt with key binding <prefix>:
run-shell "ps -o state= -o comm= -t $(tmux display -p '#{pane_tty}') > tmux-debug.txt"

This should dump the process names to a file called tmux-debug.txt. That will help me debug things.

caerlie commented 8 years ago

Hey @christoomey

1, yes, i can move between splits in Vim, and panes in tmux. olny fail with Vim window to tmux pane.

2,tmux-debug.txt

thank You !

christoomey commented 8 years ago

@blueyed Can you help with debugging the process list as shown in tmux-debug.txt? Wondering if we might have hit a platform difference with Ubuntu?

mb720 commented 6 years ago

Hi!

I, too, can navigate between splits and panes containing bash, but once I've entered a pane with Vim, I can't use the ctrl + movement shortcuts anymore.

I've created tmux-debug.txt with this content

S bash
S udiskie
S vim

uname -a gives

Linux marathon 4.13.7-1-ARCH #1 SMP PREEMPT Sat Oct 14 20:13:26 CEST 2017 x86_64 GNU/Linux

Thanks for your great work!

Edit

My bad. Instead of installing the plugin the proper way (i.e., adding Plugin 'christoomey/vim-tmux-navigator' to .vimrc and executing :PluginInstall), I had simply added this to my .vimrc which is suggested in this blog entry:

nnoremap <C-j> <C-w><C-j>
nnoremap <C-k> <C-w><C-k>
nnoremap <C-l> <C-w><C-l>
nnoremap <C-h> <C-w><C-h>
nnoremap <C-\> <C-w><C-p>

Sorry for the mixup.

Keris commented 6 years ago

Hey

I encountered the same problem that I can navigate between vim splits, and tmux panels, but once I entered a panel with vim open, I cannot navigate out using ctrl+[h|j|k|l].

The tmux-debug.txt generated with the following content:

Ss   -zsh
S+   nvim
S+   /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
S+   /usr/local/Cellar/python@2/2.7.15/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

The environment details as follows:

os: macOS High Sierra 10.13.4
iTerm2 version: 3.1.6
tmux version: 2.7

Thanks for your great work!

blueyed commented 6 years ago

Please check https://github.com/christoomey/vim-tmux-navigator/pull/201.

AlexChalk commented 6 years ago

I was getting similar behaviour to @Keris, and similar output in the debugging:

Ss   -zsh
S+   nvim
S+   /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python
S+   tmux

Env:

os: macOS High Sierra 10.13.5
iTerm2 version: 3.1.5
tmux: 2.7

The solution for me was replacing the inlined grep pattern with the alternative mentioned at the bottom of the readme: https://github.com/mislav/dotfiles/blob/master/bin/tmux-vim-select-pane

@christoomey If this is a 'more robust check', is it worth making it the default instruction? I'll make a PR on the Readme if you'd welcome it.

blueyed commented 6 years ago

Please try https://github.com/christoomey/vim-tmux-navigator/pull/201 - it is meant to work much better.