Merge branch 'master' into dev
This commit is contained in:
commit
fb3cf54b9f
3 files changed
+9
-7
No files matched your search
@@ -58,7 +58,7 @@ NOTES
|
|||||||
Set $_Z_NO_PROMPT_COMMAND to handle PROMPT_COMMAND/precmd your-
|
Set $_Z_NO_PROMPT_COMMAND to handle PROMPT_COMMAND/precmd your-
|
||||||
self.
|
self.
|
||||||
Set $_Z_EXCLUDE_DIRS to an array of directories to exclude.
|
Set $_Z_EXCLUDE_DIRS to an array of directories to exclude.
|
||||||
(These settings should go in .bashrc/.zshrc before the lines
|
(These settings should go in .bashrc/.zshrc before the line
|
||||||
added above.)
|
added above.)
|
||||||
Install the provided man page z.1 somewhere like
|
Install the provided man page z.1 somewhere like
|
||||||
/usr/local/man/man1.
|
/usr/local/man/man1.
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ Set \fB$_Z_NO_PROMPT_COMMAND\fR to handle \fBPROMPT_COMMAND/precmd\fR yourself.
|
|||||||
Set \fB$_Z_EXCLUDE_DIRS\fR to an array of directories to exclude.
|
Set \fB$_Z_EXCLUDE_DIRS\fR to an array of directories to exclude.
|
||||||
.RE
|
.RE
|
||||||
.RS
|
.RS
|
||||||
(These settings should go in .bashrc/.zshrc before the lines added above.)
|
(These settings should go in .bashrc/.zshrc before the line added above.)
|
||||||
.RE
|
.RE
|
||||||
.RS
|
.RS
|
||||||
Install the provided man page \fBz.1\fR somewhere like \fB/usr/local/man/man1\fR.
|
Install the provided man page \fBz.1\fR somewhere like \fB/usr/local/man/man1\fR.
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ _z() {
|
|||||||
if [ $? -ne 0 -a -f "$datafile" ]; then
|
if [ $? -ne 0 -a -f "$datafile" ]; then
|
||||||
env rm -f "$tempfile"
|
env rm -f "$tempfile"
|
||||||
else
|
else
|
||||||
env mv -f "$tempfile" "$datafile" || env rm -f "$tmpfile"
|
env mv -f "$tempfile" "$datafile" || env rm -f "$tempfile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# tab completion
|
# tab completion
|
||||||
@@ -103,7 +103,7 @@ _z() {
|
|||||||
else
|
else
|
||||||
# list/go
|
# list/go
|
||||||
while [ "$1" ]; do case "$1" in
|
while [ "$1" ]; do case "$1" in
|
||||||
--) while [ "$1" ]; do shift; local fnd="$fnd $1";done;;
|
--) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;;
|
||||||
-*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
|
-*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
|
||||||
c) local fnd="^$PWD $fnd";;
|
c) local fnd="^$PWD $fnd";;
|
||||||
h) echo "${_Z_CMD:-z} [-chlrtx] args" >&2; return;;
|
h) echo "${_Z_CMD:-z} [-chlrtx] args" >&2; return;;
|
||||||
@@ -112,7 +112,7 @@ _z() {
|
|||||||
r) local typ="rank";;
|
r) local typ="rank";;
|
||||||
t) local typ="recent";;
|
t) local typ="recent";;
|
||||||
esac; opt=${opt:1}; done;;
|
esac; opt=${opt:1}; done;;
|
||||||
*) local fnd="$fnd $1";;
|
*) local fnd="$fnd${fnd:+ }$1";;
|
||||||
esac; local last=$1; shift; done
|
esac; local last=$1; shift; done
|
||||||
[ "$fnd" -a "$fnd" != "^$PWD " ] || local list=1
|
[ "$fnd" -a "$fnd" != "^$PWD " ] || local list=1
|
||||||
|
|
||||||
@@ -218,7 +218,9 @@ if compctl >/dev/null 2>&1; then
|
|||||||
_z --add "${PWD:A}"
|
_z --add "${PWD:A}"
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
precmd_functions+=(_z_precmd)
|
[[ -n "${precmd_functions[(r)_z_precmd]}" ]] || {
|
||||||
|
precmd_functions[$(($#precmd_functions+1))]=_z_precmd
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_z_zsh_tab_completion() {
|
_z_zsh_tab_completion() {
|
||||||
# tab completion
|
# tab completion
|
||||||
@@ -233,7 +235,7 @@ elif complete >/dev/null 2>&1; then
|
|||||||
complete -o filenames -C '_z --complete "$COMP_LINE"' ${_Z_CMD:-z}
|
complete -o filenames -C '_z --complete "$COMP_LINE"' ${_Z_CMD:-z}
|
||||||
[ "$_Z_NO_PROMPT_COMMAND" ] || {
|
[ "$_Z_NO_PROMPT_COMMAND" ] || {
|
||||||
# populate directory list. avoid clobbering other PROMPT_COMMANDs.
|
# populate directory list. avoid clobbering other PROMPT_COMMANDs.
|
||||||
grep -q "_z --add" <<< "$PROMPT_COMMAND" || {
|
grep "_z --add" <<< "$PROMPT_COMMAND" >/dev/null || {
|
||||||
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_z --add "$(pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
|
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_z --add "$(pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user