# }}}
# {{{ set some variables
-#v#
if check_com -c vim ; then
+#v#
export EDITOR=${EDITOR:-vim}
else
export EDITOR=${EDITOR:-vi}
fi
+
#v#
+(( ${+PAGER} )) || export PAGER="less"
+#v#
export MAIL=${MAIL:-/var/mail/$USER}
# if we don't set $SHELL then aterm, rxvt,.. will use /bin/sh or /bin/bash :-/
#
# For a broader description, see:
# <http://bewatermyfriend.org/posts/2007/12-26.11-50-38-tooltime.html>
+#
+# The code is imported from the file 'zsh/functions/accept-line' from
+# <http://ft.bewatermyfriend.org/comp/zsh/zsh-dotfiles.tar.bz2>, which
+# distributed under the same terms as zsh itself.
# A newly added command will may not be found or will cause false
# correction attempts, if you got auto-correction set. By setting the
fi
chpwd() {
- builtin dirs -pl >! ~/.zdirs
+ builtin print -l ${(u)dirstack} >! ~/.zdirs
}
# }}}
preexec () {
[[ -n $NOPRECMD ]] && return 0
# set hostname if not running on host with name 'grml'
- if [[ "$HOSTNAME" != $(hostname) ]] ; then
+ if [[ -n "$HOSTNAME" ]] && [[ "$HOSTNAME" != $(hostname) ]] ; then
NAME="@$HOSTNAME"
fi
# get the name of the program currently running and hostname of local machine
# manzsh() { man zshall | $MYLESS -p $1 ; }
fi
-if check_com -c most ; then
+if check_com -c $PAGER ; then
#f1# View Debian's changelog of a given package
dchange() {
if [[ -r /usr/share/doc/${1}/changelog.Debian.gz ]] ; then
- most /usr/share/doc/${1}/changelog.Debian.gz
+ $PAGER /usr/share/doc/${1}/changelog.Debian.gz
elif [[ -r /usr/share/doc/${1}/changelog.gz ]] ; then
- most /usr/share/doc/${1}/changelog.gz
+ $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."
#f1# View Debian's NEWS of a given package
dnews() {
if [[ -r /usr/share/doc/${1}/NEWS.Debian.gz ]] ; then
- most /usr/share/doc/${1}/NEWS.Debian.gz
+ $PAGER /usr/share/doc/${1}/NEWS.Debian.gz
else
if [[ -r /usr/share/doc/${1}/NEWS.gz ]] ; then
- most /usr/share/doc/${1}/NEWS.gz
+ $PAGER /usr/share/doc/${1}/NEWS.gz
else
echo "No NEWS file for package $1 found, sorry."
return 1
#f1# View upstream's changelog of a given package
uchange() {
if [[ -r /usr/share/doc/${1}/changelog.gz ]] ; then
- most /usr/share/doc/${1}/changelog.gz
+ $PAGER /usr/share/doc/${1}/changelog.gz
else
echo "No changelog for package $1 found, sorry."
return 1