also ignore subdirs of _Z_EXCLUDE_DIRS
This commit is contained in:
1 parent
b620b0a8af
commit
c507bdd707
3 files changed
+7
-7
No files matched your search
@@ -60,7 +60,7 @@ NOTES
|
||||
Set $_Z_NO_RESOLVE_SYMLINKS to prevent symlink resolution.
|
||||
Set $_Z_NO_PROMPT_COMMAND to handle PROMPT_COMMAND/precmd your-
|
||||
self.
|
||||
Set $_Z_EXCLUDE_DIRS to an array of directories to exclude.
|
||||
Set $_Z_EXCLUDE_DIRS to an array of directory trees to exclude.
|
||||
Set $_Z_OWNER to allow usage when in 'sudo -s' mode.
|
||||
(These settings should go in .bashrc/.zshrc before the line
|
||||
added above.)
|
||||
@@ -121,8 +121,8 @@ ENVIRONMENT
|
||||
to handle PROMPT_COMMAND or precmd yourself.
|
||||
|
||||
The environment variable $_Z_EXCLUDE_DIRS can be set to an array of
|
||||
directories to exclude from tracking. $HOME is always excluded. Direc-
|
||||
tories must be full paths without trailing slashes.
|
||||
directory trees to exclude from tracking. $HOME is always excluded.
|
||||
Directories must be full paths without trailing slashes.
|
||||
|
||||
The environment variable $_Z_OWNER can be set to your username, to
|
||||
allow usage of z when your sudo enviroment keeps $HOME set.
|
||||
|
||||
@@ -81,7 +81,7 @@ Set \fB$_Z_NO_RESOLVE_SYMLINKS\fR to prevent symlink resolution.
|
||||
Set \fB$_Z_NO_PROMPT_COMMAND\fR to handle \fBPROMPT_COMMAND/precmd\fR yourself.
|
||||
.RE
|
||||
.RS
|
||||
Set \fB$_Z_EXCLUDE_DIRS\fR to an array of directories to exclude.
|
||||
Set \fB$_Z_EXCLUDE_DIRS\fR to an array of directory trees to exclude.
|
||||
.RE
|
||||
.RS
|
||||
Set \fB$_Z_OWNER\fR to allow usage when in 'sudo -s' mode.
|
||||
@@ -147,7 +147,7 @@ The environment variable \fB$_Z_NO_PROMPT_COMMAND\fR can be set if you want to
|
||||
handle \fBPROMPT_COMMAND\fR or \fBprecmd\fR yourself.
|
||||
.P
|
||||
The environment variable \fB$_Z_EXCLUDE_DIRS\fR can be set to an array of
|
||||
directories to exclude from tracking. \fB$HOME\fR is always excluded.
|
||||
directory trees to exclude from tracking. \fB$HOME\fR is always excluded.
|
||||
Directories must be full paths without trailing slashes.
|
||||
.P
|
||||
The environment variable \fB$_Z_OWNER\fR can be set to your username, to
|
||||
|
||||
@@ -41,10 +41,10 @@ _z() {
|
||||
# $HOME isn't worth matching
|
||||
[ "$*" = "$HOME" ] && return
|
||||
|
||||
# don't track excluded dirs
|
||||
# don't track excluded directory trees
|
||||
local exclude
|
||||
for exclude in "${_Z_EXCLUDE_DIRS[@]}"; do
|
||||
[ "$*" = "$exclude" ] && return
|
||||
case "$*" in $exclude*) return;; esac
|
||||
done
|
||||
|
||||
# maintain the data file
|
||||
|
||||
Reference in new issue
Block a user