fi
# completion system
+COMPDUMPFILE=${COMPDUMPFILE:-${ZDOTDIR:-${HOME}}/.zcompdump}
if zrcautoload compinit ; then
- compinit || print 'Notice: no compinit available :('
+ compinit -d ${COMPDUMPFILE} || print 'Notice: no compinit available :('
else
print 'Notice: no compinit available :('
function compdef { }
# use generic completion system for programs not yet defined; (_gnu_generic works
# with commands that provide a --help option with "standard" gnu-like output.)
- for compcom in cp deborphan df feh fetchipac head hnb ipacsum mv \
+ for compcom in cp deborphan df feh fetchipac gpasswd head hnb ipacsum mv \
pal stow tail uname ; do
[[ -z ${_comps[$compcom]} ]] && compdef _gnu_generic ${compcom}
done; unset compcom
#f1# List symlinks in detail (more detailed version of 'readlink -f' and 'whence -s')
sll() {
[[ -z "$1" ]] && printf 'Usage: %s <file(s)>\n' "$0" && return 1
+ local file
for file in "$@" ; do
while [[ -h "$file" ]] ; do
ls -l $file
# PAGER='less -Mr' - If so, the use of $PAGER here needs fixing
# with respect to wordsplitting. (ie. ${=PAGER})
if check_com -c $PAGER ; then
- #f3# View Debian's changelog of a given package
+ #f3# View Debian's changelog of given package(s)
dchange() {
emulate -L zsh
- if [[ -r /usr/share/doc/$1/changelog.Debian.gz ]] ; then
- $PAGER /usr/share/doc/$1/changelog.Debian.gz
- elif [[ -r /usr/share/doc/$1/changelog.gz ]] ; then
- $PAGER /usr/share/doc/$1/changelog.gz
- else
- if check_com -c aptitude ; then
- echo "No changelog for package $1 found, using aptitude to retrieve it."
- if isgrml ; then
- aptitude -t unstable changelog $1
+ [[ -z "$1" ]] && printf 'Usage: %s <package_name(s)>\n' "$0" && return 1
+
+ local package
+ for package in "$@" ; do
+ if [[ -r /usr/share/doc/${package}/changelog.Debian.gz ]] ; then
+ $PAGER /usr/share/doc/${package}/changelog.Debian.gz
+ elif [[ -r /usr/share/doc/${package}/changelog.gz ]] ; then
+ $PAGER /usr/share/doc/${package}/changelog.gz
+ elif [[ -r /usr/share/doc/${package}/changelog ]] ; then
+ $PAGER /usr/share/doc/${package}/changelog
+ else
+ if check_com -c aptitude ; then
+ echo "No changelog for package $package found, using aptitude to retrieve it."
+ aptitude changelog "$package"
+ elif check_com -c apt-get ; then
+ echo "No changelog for package $package found, using apt-get to retrieve it."
+ apt-get changelog "$package"
else
- aptitude changelog $1
+ echo "No changelog for package $package found, sorry."
fi
- else
- echo "No changelog for package $1 found, sorry."
- return 1
fi
- fi
+ done
}
_dchange() { _files -W /usr/share/doc -/ }
compdef _dchange dchange
}
fi
-# make a backup of a file
-bk() {
- cp -a "$1" "${1}_$(date --iso-8601=seconds)"
-}
-
ssl_hashes=( sha512 sha256 sha1 md5 )
for sh in ${ssl_hashes}; do
check_com new || alias new=modified
# use colors when GNU grep with color-support
-#a2# Execute \kbd{grep -{}-color=auto}
-(( $#grep_options > 0 )) && alias grep='grep '${grep_options:+"${grep_options[*]}"}
+if (( $#grep_options > 0 )); then
+ o=${grep_options:+"${grep_options[*]}"}
+ #a2# Execute \kbd{grep -{}-color=auto}
+ alias grep='grep '$o
+ alias egrep='egrep '$o
+ unset o
+fi
# Translate DE<=>EN
# 'translate' looks up fot a word in a file with language-to-language