Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<ESC>zle vi-mode 在可视模式下的标准行为是什么都不做。但我希望<esc>在 vi-mode 可视模式下按下的操作会将键盘映射切换到 vi-normal 模式(vicmd)。就像在标准 vi 中一样。
<ESC>
<esc>
vicmd
我试过这个:
bindkey -M visual '\e' vi-cmd-mode
但它没有用。
这是我正在使用的 vi 模式配置文件
我怎样才能达到预期的行为?
在zsh 5.0.8 中:
nin-deactivate-region() { REGION_ACTIVE=0 } zle -N nin-deactivate-region bindkey -M visual '\e' nin-deactivate-region
从zsh 5.1 你已经有了一个deactivate-region小部件,所以它会更容易:
deactivate-region
bindkey -M visual '\e' deactivate-region