From 8ebf2a678507b28cf107858b316f5e874ef73d0f Mon Sep 17 00:00:00 2001 From: Giuseppe Landolfi Date: Sun, 13 May 2018 01:53:45 +0200 Subject: [PATCH] Fine-tune dirhistory plugin mappings for Mac (#6580) See https://github.com/robbyrussell/oh-my-zsh/pull/6533#issuecomment-360878060 --- plugins/dirhistory/dirhistory.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8138872b..283dace2 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -120,7 +120,9 @@ zle -N dirhistory_zle_dirhistory_back bindkey "\e[3D" dirhistory_zle_dirhistory_back bindkey "\e[1;3D" dirhistory_zle_dirhistory_back # Mac teminal (alt+left/right) -bindkey "^[b" dirhistory_zle_dirhistory_back +if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then + bindkey "^[b" dirhistory_zle_dirhistory_back +fi # Putty: bindkey "\e\e[D" dirhistory_zle_dirhistory_back # GNU screen: @@ -129,7 +131,9 @@ 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 -bindkey "^[f" dirhistory_zle_dirhistory_future +if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]]; then + bindkey "^[f" dirhistory_zle_dirhistory_future +fi bindkey "\e\e[C" dirhistory_zle_dirhistory_future bindkey "\eO3C" dirhistory_zle_dirhistory_future