linux - vim key maps not working after reattach to tmux session over ssh -
a little bit of context: i'm using vimx (that x display campatible version of terminal vim redhat gives me ability work + , * x clipboard registers in vim). ssh server (with x forwarding using -y option) , run vim (ie. vimx) in tmux. if detach tmux session , attach again in same ssh session, every thing works fine. however, if logout of ssh session , log in , attach tmux session (which running vim), vim key binding , key mappings (like ctrl+n new tab) , vim commands (like ":buffers" displaying vim buffers or ":reg" displaying registers) won't work more until close vim , reopen again. suspect x11 display problem in vim , tmux, not able find what's going wrong in vim or tmux.
the summary of problem , how reproduce it:
1) ssh server: ssh -y user@server
2) open new tmux session: tmux -2
3) open vimx: vimx myfile.cc
4) detach tmux: ctrl+b d
5) logout ssh session: type exit in terminal or press ctrl+d
6) reconnect server: ssh -y user@server
7) reattach tmux session: tmux -2 attach
in step 7, reattached vimx session however, none of vim key mappings or commands vim work now. (they fixed if close , reopen vim in case tmux working vim remotely?! :) )
rather restarting vim, use :source command reload vimrc.
:so ~/.vimrc
that's easier restart , work in middle of editing file.
Comments
Post a Comment