Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panes no longer switching for <c-j> and <c-k> specifically #223

Open
megalithic opened this issue Dec 21, 2018 · 3 comments
Open

panes no longer switching for <c-j> and <c-k> specifically #223

megalithic opened this issue Dec 21, 2018 · 3 comments

Comments

@megalithic
Copy link

so, something has changed, not sure yet.. still debugging.

what i do know is, with :TmuxNavigatorProcessList, I see the following (notice, no tmux process):

Ss   -zsh                                                                                                                                                                                                                                                                                                                           
S+   nvim

Press ENTER or type command to continue

i've checked to see what my <c-j> and <c-k> are bound to, and both are bound to the appropriate TmuxNavigatorDown and TmuxNavigatorUp commands respectively. I used :map <c-j> and :map <c-k> to determine those mappings.

Any one else hitting these issues? My <c-h> and <c-l> bindings are working fine though.

@christoomey
Copy link
Owner

We don’t expect to see tmux in the process list since we’re looking at the process tree of the current pane. Tmux wraps around Vim, so everything in the process list looks fine and the tmux bindings should match the “nvim” process name.

Couple of questions:

  1. Does navigation between tmux panes (no Vim involved) work in all directions?
  2. Can you share the tmux bindings you have configured?
  3. Can you confirm what each of the navigation mappings are mapped to in Vim (:verbose nmap <c-j>)

@megalithic
Copy link
Author

megalithic commented Dec 22, 2018

@christoomey thank you for taking the time to work with me on this.

  1. unfortunately, no, only left and right movements (via <c-h> and <c-l>)
  2. the tmux key bindings (i've tried with the tpm plugin and without, with the snippets and without)
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(weechat|irc|view|emacs|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 -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
  1. the :verbose mapping output:
n  <NL>        * :TmuxNavigateDown<CR>
              Last set from ~/.dotfiles/nvim/init.vim
n  <C-K>        * :TmuxNavigateUp<CR>
              Last set from ~/.dotfiles/nvim/init.vim
n  <C-H>        * :TmuxNavigateLeft<CR>
              Last set from ~/.dotfiles/nvim/init.vim
n  <C-L>        * :TmuxNavigateRight<CR>
              Last set from ~/.dotfiles/nvim/init.vim

What's interesting is, when i create a new tmux horizontal split and try and press <c-j> and <c-k> repeatedly, for the minimal time it takes for the split to generate, i get the keycode output of: ^[[1;3A^[[1;3B^; doing the same but for a vertical split, but pressing <c-h> and <c-l>, it immediately selects the appropriate right/left panes.

Final notes..
In order to rule out other variables, I've tried bash and zsh (with vi-mode on and off). I've tried Terminal.app, kitty.app, and iTerm.app and all behave the same way. I made sure karabiner-elements.app wasn't running, since I had some custom complex modifications in there to mimic vim movement keys across OSX (this all worked fine until recently, just not sure yet what the change was, what app was introduced or what config was changed).

A huge thanks once again, for helping to debug through this.

@marcw
Copy link

marcw commented Dec 23, 2019

Chiming in as I'm also affected by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants