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() { dirs -pl >! ~/.zdirs }
+# }}}
+
# {{{ display battery status on right side of prompt via running 'BATTERY=1 zsh'
if [ -n "$BATTERY" ] ; then
if [ -x =acpi ] ; then
# precmd () { setopt promptsubst; [[ -o interactive ]] && jobs -l;
- is4 && ! [[ -n "$NOPRECMD" ]] && precmd () {
- (( NOPRECMD > 0 )) && return 0
+ is4 && [[ -z $NOPRECMD ]] && precmd () {
+ [[ -n $NOPRECMD ]] && return 0
# just use DONTSETRPROMPT=1 to be able to overwrite RPROMPT
if [[ -z ${DONTSETRPROMPT} ]] ; then
if [ -n "$BATTERY" ] ; then
# chpwd () => a function which is executed whenever the directory is changed
# preexec() => a function running before every command
- is4 && ! [[ -n "$NOPRECMD" ]] && preexec () {
- (( NOPRECMD > 0 )) && return 0
+ is4 && [[ -z $NOPRECMD ]] && preexec () {
+ [[ -n $NOPRECMD ]] && return 0
# set hostname if not running on host with name 'grml'
local HOSTNAME=$(hostname)
if [[ "$HOSTNAME" != grml ]] ; then
zstyle ':completion:*:history-words' menu yes # activate menu
zstyle ':completion:*:history-words' remove-all-dups yes # ignore duplicate entries
zstyle ':completion:*:history-words' stop yes #
- zstyle ':completion:*:*:linda:*' file-patterns '*.deb' # complete debian packages for command 'linda'
- zstyle ':completion:*:*:lintian:*' file-patterns '*.deb' # complete debian packages for command 'lintian'
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # match uppercase from lowercase
zstyle ':completion:*:matches' group 'yes' # separate matches into groups
zstyle ':completion:*' group-name ''
# shell functions {{{
setenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" } # csh compatibility
freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done }
- manzsh() { /usr/bin/man zshall | vim -c "se ft=man| se hlsearch" +/"$1" - ; }
-# manzsh() { /usr/bin/man zshall | most +/"$1" ; }
-# manzsh() { man zshall | $MYLESS -p $1 ; }
+
+ # fast manual access
+ if type -p qma &>/dev/null ; then
+ manzsh() { qma zshall "$1" }
+ else
+ manzsh() { /usr/bin/man zshall | vim -c "se ft=man| se hlsearch" +/"$1" - ; }
+ # manzsh() { /usr/bin/man zshall | most +/"$1" ; }
+ # manzsh() { man zshall | $MYLESS -p $1 ; }
+ fi
# use "dchange <package-name>" to view Debian's changelog of the package:
dchange() {
}
alias help-zshglob=H-Glob
- type -p fma &>/dev/null && alias ?='fma zshall'
+ type -p qma &>/dev/null && alias ?='qma zshall'
# grep for running process, like: 'any vim'
any() {