在tmux复制模式下,我想使用一些Alt +键组合键而不是箭头来移动光标。有没有办法让tmux做到这一点?
这是我想要的定义:
Alt+i: up
Alt+l: right
Alt+j: left
Alt+k: down
Alt+o: forward word
Alt+u: backward word
我不想将tmux切换到vi模式。
原来,您必须编辑emacs-copy
表的键绑定。这就是我进行上面想要的更改的方式。
首先,我通过在tmux中输入以下命令(按Prefix + colon)来检查当前绑定是什么list-keys -t emacs-copy
。这给了我一份在emacs-copy模式下绑定的键的列表,我仔细查看了它们以找出哪些命令可以执行我想要的操作。
然后,我将适当的键绑定添加到我的〜/ .tmux.conf文件中,如下所示:
bind-key -t emacs-copy M-j cursor-left
bind-key -t emacs-copy M-i cursor-up
bind-key -t emacs-copy M-l cursor-right
bind-key -t emacs-copy M-k cursor-down
bind-key -t emacs-copy M-u previous-word
bind-key -t emacs-copy M-o next-word
最后,我在tmux中运行了tmux命令source ~/.tmux.conf
以绑定键,而不必退出并重新加载会话。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句