【问题标题】:tmux: Remap h, j, k, l to j, k, l, ; in choose-tree modetmux: 将 h, j, k, l 重新映射到 j, k, l, ;在选择树模式下
【发布时间】:2022-06-28 19:21:14
【问题描述】:

是否可以在choose-tree 模式下重新映射 hjkl 键?

我尝试了以下方法:

unbind -T choose-tree h;
unbind -T choose-tree j;
unbind -T choose-tree k;
unbind -T choose-tree l;

bind -T choose-tree j send-keys -X collapse-selected-item;
bind -T choose-tree k send-keys -X select-next-item;
bind -T choose-tree l send-keys -X select-previous-item;
bind -T choose-tree \; send-keys -X expand-selected-item;

但我收到一个错误:table choose-tree doesn't exist

我也尝试将choose-tree 替换为choose-mode,但也没有用。

【问题讨论】:

  • 能否提供您的完整配置?您是否将选择树绑定到您的前缀键?

标签: tmux


【解决方案1】:

将此添加到您的配置文件中。

bind-key -T root  j if -F "#{==:#{pane_mode},tree-mode}" "send h" "send j"
bind-key -T root  k if -F "#{==:#{pane_mode},tree-mode}" "send j" "send k"
bind-key -T root  l if -F "#{==:#{pane_mode},tree-mode}" "send k" "send l"
bind-key -T root \; if -F "#{==:#{pane_mode},tree-mode}" "send l" "send \;"

参考:Is it possible to remap key bindings in choose-tree mode? : tmux

【讨论】:

    猜你喜欢
    • 2020-09-14
    • 1970-01-01
    • 2015-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-14
    相关资源
    最近更新 更多