diff options
author | Marc Cornellà <marc.cornella@live.com> | 2021-05-28 10:47:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-28 10:47:02 +0200 |
commit | 308b2314f846fba1c0e6e4a64efc95feaa304a59 (patch) | |
tree | 203ecf5ff96d790e54d725f0c737347c00ad1418 /plugins/dirhistory/dirhistory.plugin.zsh | |
parent | 7ab15bee033a1ce6791b05f4636221cba7b9505e (diff) | |
download | zsh-308b2314f846fba1c0e6e4a64efc95feaa304a59.tar.gz zsh-308b2314f846fba1c0e6e4a64efc95feaa304a59.tar.bz2 zsh-308b2314f846fba1c0e6e4a64efc95feaa304a59.zip |
fix(dirhistory): fix ALT+Left/Right key bindings for iTerm2 (#9940)
Diffstat (limited to 'plugins/dirhistory/dirhistory.plugin.zsh')
-rw-r--r-- | plugins/dirhistory/dirhistory.plugin.zsh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 0ee8c6e6a..cbac84600 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -124,10 +124,14 @@ zle -N dirhistory_zle_dirhistory_back # xterm in normal mode bindkey "\e[3D" dirhistory_zle_dirhistory_back bindkey "\e[1;3D" dirhistory_zle_dirhistory_back -# Mac teminal (alt+left/right) -if [[ "$TERM_PROGRAM" == "Apple_Terminal" || "$TERM_PROGRAM" == "iTerm.app" ]]; then +# Terminal.app +if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then bindkey "^[b" dirhistory_zle_dirhistory_back fi +# iTerm2 +if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then + bindkey "^[^[[D" dirhistory_zle_dirhistory_back +fi # Putty: bindkey "\e\e[D" dirhistory_zle_dirhistory_back # GNU screen: @@ -136,9 +140,14 @@ bindkey "\eO3D" dirhistory_zle_dirhistory_back zle -N dirhistory_zle_dirhistory_future bindkey "\e[3C" dirhistory_zle_dirhistory_future bindkey "\e[1;3C" dirhistory_zle_dirhistory_future -if [[ "$TERM_PROGRAM" == "Apple_Terminal" || "$TERM_PROGRAM" == "iTerm.app" ]]; then +# Terminal.app +if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then bindkey "^[f" dirhistory_zle_dirhistory_future fi +# iTerm2 +if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then + bindkey "^[^[[C" dirhistory_zle_dirhistory_future +fi bindkey "\e\e[C" dirhistory_zle_dirhistory_future bindkey "\eO3C" dirhistory_zle_dirhistory_future |