diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2021-06-06 14:40:38 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2021-06-06 14:40:38 -0600 |
commit | 0144641b7d8e4e6ff6ce153039b5a827f5347904 (patch) | |
tree | 88ffb476ef9c1eb84b22006afe8a729fb27dc3c4 /plugins/dirhistory/dirhistory.plugin.zsh | |
parent | ffdc4bfe1204f911d71b136dbd95784176a44eb6 (diff) | |
parent | 706b2f3765d41bee2853b17724888d1a3f6f00d9 (diff) | |
download | zsh-0144641b7d8e4e6ff6ce153039b5a827f5347904.tar.gz zsh-0144641b7d8e4e6ff6ce153039b5a827f5347904.tar.bz2 zsh-0144641b7d8e4e6ff6ce153039b5a827f5347904.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'plugins/dirhistory/dirhistory.plugin.zsh')
-rw-r--r-- | plugins/dirhistory/dirhistory.plugin.zsh | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index ec1606940..cbac84600 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -2,7 +2,7 @@ # Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories # that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT. # -# Navigate directory hierarchy using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented) +# Navigate directory hierarchy using ALT-UP and ALT-DOWN. # ALT-UP moves to higher hierarchy (cd ..) # ALT-DOWN moves into the first directory found in alphabetical order # @@ -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) +# 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 +# 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 @@ -175,8 +184,9 @@ zle -N dirhistory_zle_dirhistory_up # xterm in normal mode bindkey "\e[3A" dirhistory_zle_dirhistory_up bindkey "\e[1;3A" dirhistory_zle_dirhistory_up -# Mac teminal (alt+up) - #bindkey "^[?" dirhistory_zle_dirhistory_up #dont know it +if [[ "$TERM_PROGRAM" == "Apple_Terminal" || "$TERM_PROGRAM" == "iTerm.app" ]]; then + bindkey "^[[A" dirhistory_zle_dirhistory_up +fi # Putty: bindkey "\e\e[A" dirhistory_zle_dirhistory_up # GNU screen: @@ -185,7 +195,8 @@ bindkey "\eO3A" dirhistory_zle_dirhistory_up zle -N dirhistory_zle_dirhistory_down bindkey "\e[3B" dirhistory_zle_dirhistory_down bindkey "\e[1;3B" dirhistory_zle_dirhistory_down -# Mac teminal (alt+down) - #bindkey "^[?" dirhistory_zle_dirhistory_down #dont know it +if [[ "$TERM_PROGRAM" == "Apple_Terminal" || "$TERM_PROGRAM" == "iTerm.app" ]]; then + bindkey "^[[B" dirhistory_zle_dirhistory_down +fi bindkey "\e\e[B" dirhistory_zle_dirhistory_down bindkey "\eO3B" dirhistory_zle_dirhistory_down |