# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change: Don Nov 30 16:15:06 CET 2006 [mika]
+# Latest change: Son Dez 17 13:52:04 CET 2006 [mika]
################################################################################
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
autoload run-help # use via 'esc-h'
# completion system
- if autoload -U compinit && [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Completion/compinit" ] && compinit 2>/dev/null ; then
- compinit
+ if autoload -U compinit && compinit 2>/dev/null ; then
+ compinit 2>/dev/null || print 'Notice: no compinit available :('
else
print 'Notice: no compinit available :('
function zstyle { }
is4 && autoload -U zed # use ZLE editor to edit a file or function
is4 && for mod in complist deltochar mathfunc ; do
- zmodload -i zsh/${mod}
+ zmodload -i zsh/${mod} 2>/dev/null || print "Notice: no ${mod} available :("
done
# autoload zsh modules when they are referenced
isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history
# }}}
+# dirstack handling {{{
+ DIRSTACKSIZE=20
+ if [[ -f ~/.zdirs ]] && [[ ${#dirstack[*]} -eq 0 ]]; then
+ dirstack=( ${(uf)"$(< ~/.zdirs)"} )
+ # "cd -" won't work after login by just setting $OLDPWD, so
+ cd $dirstack[0] && cd $OLDPWD
+ fi
+ chpwd() {
+ builtin dirs -pl >! ~/.zdirs
+ }
+# }}}
+
# {{{ display battery status on right side of prompt via running 'BATTERY=1 zsh'
if [ -n "$BATTERY" ] ; then
if [ -x =acpi ] ; then