我使用vim,因此我想更改几个tmux的默认绑定。特别是我想改变调整大小命令,以便例如ctrl-b ctrl-k将拆分调整为一个位置。我在.tmux.conf中输入以下内容:
bind-key C-k resizep -U
并且它有效,除了它只允许我在我再次点击ctrl之前一次调整一个单位。换句话说,我无法按住ctrl并按b然后按下一堆(同时仍然按住ctrl),而我可以按住ctrl,按b,然后按向上箭头键一堆次。
有没有人确切知道为什么会这样,或者我如何复制我想要的行为?
答案 0 :(得分:1)
您需要在命令中指定-r
参数:
bind-key -r C-k resizep -U
如tmux手册页中所述:
bind-key [-cnr] [-t mode-table] key command [arguments]
(alias: bind)
Bind key key to command. By default (without -t) the primary
key bindings are modified (those normally activated with the
prefix key); in this case, if -n is specified, it is not neces‐
sary to use the prefix key, command is bound to key alone. The
-r flag indicates this key may repeat, see the repeat-time
option.