2016-03-08 22 views
0

我使用vim,所以我想更改幾個tmux的默認綁定。特別是我想改變調整大小的命令,例如, ctrl-b ctrl-k將分割的大小調整一個位置。我輸入了以下到我.tmux.conf:tmux更改了鍵綁定(resizep)沒有按預期工作

bind-key C-k resizep -U 

和它的作品,但它僅允許我通過一個單位一次調整之前,我不得不再次按下ctrl。換句話說,我不能按住ctrl鍵,然後按b鍵,然後按k鍵(同時按住ctrl鍵),而按住ctrl鍵,按b鍵,然後按向上箭頭鍵一堆。

有誰知道這到底是爲什麼,或者我會如何複製我想要的行爲?

回答

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. 
+0

謝謝!正是我在找什麼。有點尷尬,我錯過了它。 –