christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.13k stars 321 forks source link

Navigating between nvim splits doesn't work with nvim.appimage #213

Open niklaas opened 5 years ago

niklaas commented 5 years ago

When using nvim.appimage from official releases (https://github.com/neovim/neovim/releases) navigating within nvim between splits doesn't work. I assume this has something to do with

is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h"  "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j"  "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k"  "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l"  "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"

which catches the input (e.g. <c-j>) because grep -iqE ... doesn't match on nvim.appimage.

I already tried renaming nvim.appimage to nvim and copying it into /usr/bin but that didn't solve the issue. I don't want to fiddle around with above regex though because it seems quite sophisticated. :-)

When removing above lines from my .tmux.conf I can navigate between splits in nvim.appimage again. That said, obviously I then can no longer use navigation between nvim and tmux splits.

blueyed commented 5 years ago

201 should solve this.

christoomey commented 5 years ago

Can you share the output of running : TmuxNavigatorProcessList in Vim as described here?

niklaas commented 5 years ago

@christoomey sorry, I forgot about that.

:TmuxNavigatorProcessList run in nvim.appimage:

> bin/nvim.appimage --version | head -1
NVIM v0.3.2-152-g1593ee7cf
S zsh
S AppRun

:TmuxNavigatorProcessList run in nvim (distro install):

> nvim --version | head -1
NVIM 0.1.7
S zsh
S nvim
S tmux: client

:TmuxNavigatorProcessList run in vim:

> vim --version | head -1
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 30 2017 18:21:38)
S zsh
S vim
S tmux: client

Ha! So, I guess AppRun isn't caugth by the regex.

@blueyed I'll go through #201 later.

I'll keep you both updated.

niklaas commented 5 years ago

To be honest, I am not quite sure what to make of #201. As far as I understand the discussion, the proposed fix requires a newer tmux version -- mine is 2.3 though.

Probably I should keep things simple and just use the nvim version distributed by the package manager.

niklaas commented 5 years ago

I just figured out that building nvim from source works.

blueyed commented 5 years ago

Yes, it is certainly the regex/process name here. Maybe the appimage could set this somehow? (so it does not show up as "AppRun")

As for #201 the tmux.conf from https://github.com/christoomey/vim-tmux-navigator/pull/201#issuecomment-400220865 works with older tmux versions.

blueyed commented 5 years ago

You might want to ask in Neovim's issues about having better output with ps for the appimage. (I have not used them myself, so have no experience)

jessebett commented 5 years ago

This is also a problem for me. My sysadmin installed neovim and made it available to me only as an appimage.