# }}}
+# {{{ set some important options (as early as possible)
+# Please update these tags, if you change the umask settings below.
+#o# r_umask 002
+#o# r_umaskstr rwxrwxr-x
+#o# umask 022
+#o# umaskstr rwxr-xr-x
+(( EUID != 0 )) && umask 002 || umask 022
+
+setopt append_history # append history list to the history file (important for multiple parallel zsh sessions!)
+is4 && setopt SHARE_HISTORY # import new commands from the history file also in other zsh-session
+setopt extended_history # save each command's beginning timestamp and the duration to the history file
+is4 && setopt histignorealldups # If a new command line being added to the history
+ # list duplicates an older one, the older command is removed from the list
+setopt histignorespace # remove command lines from the history list when
+ # the first character on the line is a space
+setopt auto_cd # if a command is issued that can't be executed as a normal command,
+ # and the command is the name of a directory, perform the cd command to that directory
+setopt extended_glob # in order to use #, ~ and ^ for filename generation
+ # grep word *~(*.gz|*.bz|*.bz2|*.zip|*.Z) ->
+ # -> searches for word not in compressed files
+ # don't forget to quote '^', '~' and '#'!
+setopt longlistjobs # display PID when suspending processes as well
+setopt notify # report the status of backgrounds jobs immediately
+setopt hash_list_all # Whenever a command completion is attempted, make sure \
+ # the entire command path is hashed first.
+setopt completeinword # not just at the end
+setopt nohup # and don't kill them, either
+setopt auto_pushd # make cd push the old directory onto the directory stack.
+setopt nonomatch # try to avoid the 'zsh: no matches found...'
+setopt nobeep # avoid "beep"ing
+setopt pushd_ignore_dups # don't push the same dir twice.
+setopt noglobdots # * shouldn't match dotfiles. ever.
+setopt noshwordsplit # use zsh style word splitting
+
+# }}}
+
# setting some default values {{{
NOCOR=${NOCOR:-0}
BATTERY=${BATTERY:-0}
GRMLSMALL_SPECIFIC=${GRMLSMALL_SPECIFIC:-1}
GRML_ALWAYS_LOAD_ALL=${GRML_ALWAYS_LOAD_ALL:-0}
+ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0}
if isgrmlcd ; then
GRML_WARN_SKEL=${GRML_WARN_SKEL:-0}
# this function checks if a command exists and returns either true
# or false. This avoids using 'which' and 'whence', which will
# avoid problems with aliases for which on certain weird systems. :-)
+# Usage: check_com [-c|-g] word
+# -c only checks for external commands
+# -g does the usual tests and also checks for global aliases
check_com() {
- local -i comonly
+ local -i comonly gatoo
if [[ ${1} == '-c' ]] ; then
(( comonly = 1 ))
shift
+ elif [[ ${1} == '-g' ]] ; then
+ (( gatoo = 1 ))
else
(( comonly = 0 ))
+ (( gatoo = 0 ))
fi
if (( ${#argv} != 1 )) ; then
return 0
fi
+ if (( gatoo > 0 )) && [[ -n ${galiases[$1]} ]] ; then
+ return 0
+ fi
+
return 1
}
#}}}
# locale setup {{{
-xsource "/etc/default/locale"
+if (( ZSH_NO_DEFAULT_LOCALE == 0 )); then
+ xsource "/etc/default/locale"
+fi
for var in LANG LC_ALL LC_MESSAGES ; do
[[ -n ${(P)var} ]] && export $var
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
+MAILCHECK=30 # mailchecks
+REPORTTIME=5 # report about cpu-/system-/user-time of command if running longer than 5 seconds
+watch=(notme root) # watch for everyone but me and root
+
# automatically remove duplicates from these arrays
typeset -U path cdpath fpath manpath
# }}}
zle -N commit-to-history
bindkey "^x^h" commit-to-history
+# only slash should be considered as a word separator:
+slash-backward-kill-word() {
+ local WORDCHARS="${WORDCHARS:s@/@}"
+ # zle backward-word
+ zle backward-kill-word
+}
+zle -N slash-backward-kill-word
+
+#k# Kill everything in a word up to its last \kbd{/}
+bindkey '\ev' slash-backward-kill-word
+
# }}}
# a generic accept-line wrapper {{{
# }}}
-# {{{ set some important options
-# Please update these tags, if you change the umask settings below.
-#o# r_umask 002
-#o# r_umaskstr rwxrwxr-x
-#o# umask 022
-#o# umaskstr rwxr-xr-x
-(( EUID != 0 )) && umask 002 || umask 022
-
-# history:
-setopt append_history # append history list to the history file (important for multiple parallel zsh sessions!)
-is4 && setopt SHARE_HISTORY # import new commands from the history file also in other zsh-session
-setopt extended_history # save each command's beginning timestamp and the duration to the history file
-is4 && setopt histignorealldups # If a new command line being added to the history
- # list duplicates an older one, the older command is removed from the list
-setopt histignorespace # remove command lines from the history list when
- # the first character on the line is a space
-setopt auto_cd # if a command is issued that can't be executed as a normal command,
- # and the command is the name of a directory, perform the cd command to that directory
-setopt extended_glob # in order to use #, ~ and ^ for filename generation
- # grep word *~(*.gz|*.bz|*.bz2|*.zip|*.Z) ->
- # -> searches for word not in compressed files
- # don't forget to quote '^', '~' and '#'!
-setopt longlistjobs # display PID when suspending processes as well
-setopt notify # report the status of backgrounds jobs immediately
-setopt hash_list_all # Whenever a command completion is attempted, make sure \
- # the entire command path is hashed first.
-setopt completeinword # not just at the end
-setopt nohup # and don't kill them, either
-setopt auto_pushd # make cd push the old directory onto the directory stack.
-setopt nonomatch # try to avoid the 'zsh: no matches found...'
-setopt nobeep # avoid "beep"ing
-setopt pushd_ignore_dups # don't push the same dir twice.
-setopt noglobdots # * shouldn't match dotfiles. ever.
-
-MAILCHECK=30 # mailchecks
-REPORTTIME=5 # report about cpu-/system-/user-time of command if running longer than 5 seconds
-watch=(notme root) # watch for everyone but me and root
-
-# only slash should be considered as a word separator:
-slash-backward-kill-word() {
- local WORDCHARS="${WORDCHARS:s@/@}"
- # zle backward-word
- zle backward-kill-word
-}
-zle -N slash-backward-kill-word
-
-#k# Kill everything in a word up to its last \kbd{/}
-bindkey '\ev' slash-backward-kill-word
-
-# }}}
-
# {{{ history
ZSHDIR=$HOME/.zsh
alias term2utf="echo 'Setting terminal to utf-8 mode'; print -n '\e%G'"
# make sure it is not assigned yet
-[[ $(whence -w utf2iso &>/dev/null) == 'utf2iso: alias' ]] && unalias utf2iso
-
+[[ -n ${aliases[utf2iso]} ]] && unalias utf2iso
utf2iso() {
if isutfenv ; then
for ENV in $(env | command grep -i '.utf') ; do
}
# make sure it is not assigned yet
-[[ $(whence -w iso2utf &>/dev/null) == 'iso2utf: alias' ]] && unalias iso2utf
+[[ -n ${aliases[iso2utf]} ]] && unalias iso2utf
iso2utf() {
if ! isutfenv ; then
for ENV in $(env | command grep -i '\.iso') ; do
# 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 tail head feh cp mv df stow uname ipacsum fetchipac; do
+ for compcom in cp deborphan df feh fetchipac head hnb ipacsum mv \
+ pal stow tail uname ; do
[[ -z ${_comps[$compcom]} ]] && compdef _gnu_generic ${compcom}
done; unset compcom