Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
7ab15bee
Unverified
Commit
7ab15bee
authored
May 21, 2021
by
rhuitl
Committed by
GitHub
May 21, 2021
Browse files
feat(dirhistory): add ALT+UP/DOWN key bindings for iTerm2 (#8502)
parent
1bda62df
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/dirhistory/dirhistory.plugin.zsh
View file @
7ab15bee
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories
# 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.
# 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-UP moves to higher hierarchy (cd ..)
# ALT-DOWN moves into the first directory found in alphabetical order
# ALT-DOWN moves into the first directory found in alphabetical order
#
#
...
@@ -125,7 +125,7 @@ zle -N dirhistory_zle_dirhistory_back
...
@@ -125,7 +125,7 @@ zle -N dirhistory_zle_dirhistory_back
bindkey
"
\e
[3D"
dirhistory_zle_dirhistory_back
bindkey
"
\e
[3D"
dirhistory_zle_dirhistory_back
bindkey
"
\e
[1;3D"
dirhistory_zle_dirhistory_back
bindkey
"
\e
[1;3D"
dirhistory_zle_dirhistory_back
# Mac teminal (alt+left/right)
# Mac teminal (alt+left/right)
if
[[
"
$TERM_PROGRAM
"
==
"Apple_Terminal"
]]
;
then
if
[[
"
$TERM_PROGRAM
"
==
"Apple_Terminal"
||
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
bindkey
"^[b"
dirhistory_zle_dirhistory_back
bindkey
"^[b"
dirhistory_zle_dirhistory_back
fi
fi
# Putty:
# Putty:
...
@@ -136,7 +136,7 @@ bindkey "\eO3D" dirhistory_zle_dirhistory_back
...
@@ -136,7 +136,7 @@ bindkey "\eO3D" dirhistory_zle_dirhistory_back
zle
-N
dirhistory_zle_dirhistory_future
zle
-N
dirhistory_zle_dirhistory_future
bindkey
"
\e
[3C"
dirhistory_zle_dirhistory_future
bindkey
"
\e
[3C"
dirhistory_zle_dirhistory_future
bindkey
"
\e
[1;3C"
dirhistory_zle_dirhistory_future
bindkey
"
\e
[1;3C"
dirhistory_zle_dirhistory_future
if
[[
"
$TERM_PROGRAM
"
==
"Apple_Terminal"
]]
;
then
if
[[
"
$TERM_PROGRAM
"
==
"Apple_Terminal"
||
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
bindkey
"^[f"
dirhistory_zle_dirhistory_future
bindkey
"^[f"
dirhistory_zle_dirhistory_future
fi
fi
bindkey
"
\e\e
[C"
dirhistory_zle_dirhistory_future
bindkey
"
\e\e
[C"
dirhistory_zle_dirhistory_future
...
@@ -175,8 +175,9 @@ zle -N dirhistory_zle_dirhistory_up
...
@@ -175,8 +175,9 @@ zle -N dirhistory_zle_dirhistory_up
# xterm in normal mode
# xterm in normal mode
bindkey
"
\e
[3A"
dirhistory_zle_dirhistory_up
bindkey
"
\e
[3A"
dirhistory_zle_dirhistory_up
bindkey
"
\e
[1;3A"
dirhistory_zle_dirhistory_up
bindkey
"
\e
[1;3A"
dirhistory_zle_dirhistory_up
# Mac teminal (alt+up)
if
[[
"
$TERM_PROGRAM
"
==
"Apple_Terminal"
||
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
#bindkey "^[?" dirhistory_zle_dirhistory_up #dont know it
bindkey
"^[[A"
dirhistory_zle_dirhistory_up
fi
# Putty:
# Putty:
bindkey
"
\e\e
[A"
dirhistory_zle_dirhistory_up
bindkey
"
\e\e
[A"
dirhistory_zle_dirhistory_up
# GNU screen:
# GNU screen:
...
@@ -185,7 +186,8 @@ bindkey "\eO3A" dirhistory_zle_dirhistory_up
...
@@ -185,7 +186,8 @@ bindkey "\eO3A" dirhistory_zle_dirhistory_up
zle
-N
dirhistory_zle_dirhistory_down
zle
-N
dirhistory_zle_dirhistory_down
bindkey
"
\e
[3B"
dirhistory_zle_dirhistory_down
bindkey
"
\e
[3B"
dirhistory_zle_dirhistory_down
bindkey
"
\e
[1;3B"
dirhistory_zle_dirhistory_down
bindkey
"
\e
[1;3B"
dirhistory_zle_dirhistory_down
# Mac teminal (alt+down)
if
[[
"
$TERM_PROGRAM
"
==
"Apple_Terminal"
||
"
$TERM_PROGRAM
"
==
"iTerm.app"
]]
;
then
#bindkey "^[?" dirhistory_zle_dirhistory_down #dont know it
bindkey
"^[[B"
dirhistory_zle_dirhistory_down
fi
bindkey
"
\e\e
[B"
dirhistory_zle_dirhistory_down
bindkey
"
\e\e
[B"
dirhistory_zle_dirhistory_down
bindkey
"
\e
O3B"
dirhistory_zle_dirhistory_down
bindkey
"
\e
O3B"
dirhistory_zle_dirhistory_down
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment