Make Alt + h switch to the left pane in Tmux

≡放荡痞女 提交于 2020-01-13 20:18:43

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!