1
- # #
2
- # Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories
1
+ # #
2
+ # Navigate directory history using ALT-LEFT and ALT-RIGHT. ALT-LEFT moves back to directories
3
3
# that the user has changed to in the past, and ALT-RIGHT undoes ALT-LEFT.
4
- #
4
+ #
5
5
# Navigate directory hierarchy using ALT-UP and ALT-DOWN. (mac keybindings not yet implemented)
6
6
# ALT-UP moves to higher hierarchy (cd ..)
7
7
# ALT-DOWN moves into the first directory found in alphabetical order
@@ -14,8 +14,8 @@ export dirhistory_future
14
14
15
15
export DIRHISTORY_SIZE=30
16
16
17
- # Pop the last element of dirhistory_past.
18
- # Pass the name of the variable to return the result in.
17
+ # Pop the last element of dirhistory_past.
18
+ # Pass the name of the variable to return the result in.
19
19
# Returns the element if the array was not empty,
20
20
# otherwise returns empty string.
21
21
function pop_past() {
@@ -32,7 +32,7 @@ function pop_future() {
32
32
fi
33
33
}
34
34
35
- # Push a new element onto the end of dirhistory_past. If the size of the array
35
+ # Push a new element onto the end of dirhistory_past. If the size of the array
36
36
# is >= DIRHISTORY_SIZE, the array is shifted
37
37
function push_past() {
38
38
if [[ $# dirhistory_past -ge $DIRHISTORY_SIZE ]]; then
@@ -76,7 +76,7 @@ function dirhistory_back() {
76
76
local d=" "
77
77
# Last element in dirhistory_past is the cwd.
78
78
79
- pop_past cw
79
+ pop_past cw
80
80
if [[ " " == " $cw " ]]; then
81
81
# Someone overwrote our variable. Recover it.
82
82
dirhistory_past=($PWD )
@@ -109,7 +109,7 @@ function dirhistory_forward() {
109
109
function dirhistory_zle_dirhistory_back() {
110
110
# Erase current line in buffer
111
111
zle kill-buffer
112
- dirhistory_back
112
+ dirhistory_back
113
113
zle accept-line
114
114
}
115
115
@@ -127,9 +127,9 @@ zle -N dirhistory_zle_dirhistory_future
127
127
bindkey " ^[[1;2A" dirhistory_zle_dirhistory_future
128
128
129
129
130
- #
130
+ #
131
131
# HIERARCHY Implemented in this section, in case someone wants to split it to another plugin if it clashes bindings
132
- #
132
+ #
133
133
134
134
# Move up in hierarchy
135
135
function dirhistory_up() {
0 commit comments