问题
I'm trying to make Alt-h switch to the left pane in Tmux. This does not work:
bind -n M-h select-pane -L
Pressing Alt-h in cat
generates the following output in my terminal:
$ cat
^[h
That is, it looks like Alt generates ^[
in my terminal. So, in my Tmux configuration, I have also tried this binding:
bind -n ^[h select-pane -L
I have made "^[" both a literal two character string (i.e., "^" + "[") as well as the special "^[" character you can access in Vim. Neither work.
How to solve this problem?
EDIT: I'm primarily using xfce4-terminal as my terminal emulator, but I've tried using gnome-terminal as well as xterm, and the problem persists.
回答1:
Actually the secret is how you enter ^[
;-)
I assume you want to edit your .vimrc
vim ~/.vimrc
- navigate to the correct position
- press i
- press ctrl-v
- press ctrl-[ (on a german keyboard I have to press ctrl-altgr-8 because altgr-8 is
[
)
After that you should have the escape sequence generated required to write the binding.
来源:https://stackoverflow.com/questions/35344479/make-alt-h-switch-to-the-left-pane-in-tmux