Skip to content

Commit

Permalink
zshrc: Move CNF handler to a better place
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Terbeck <ft@grml.org>
  • Loading branch information
ft committed Mar 5, 2013
1 parent c02da01 commit 106f481
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions etc/zsh/zshrc
Expand Up @@ -986,6 +986,17 @@ for rh in run-help{,-git,-svk,-svn}; do
zrcautoload $rh
done; unset rh

# command not found handling

(( ${COMMAND_NOT_FOUND} == 1 )) &&
function command_not_found_handler() {
emulate -L zsh
if [[ -x ${GRML_ZSH_CNF_HANDLER} ]] ; then
${GRML_ZSH_CNF_HANDLER} $1
fi
return 1
}

# completion system
if zrcautoload compinit ; then
compinit || print 'Notice: no compinit available :('
Expand Down Expand Up @@ -1241,8 +1252,6 @@ PS4='+%N:%i:%_> '
# - battery status
# - debian_chroot
# - vcs_info setup and version specific fixes
# - command-not-found handling
# (TODO: This has nothing to do with prompts: move!)

# display battery status on right side of prompt via running 'BATTERY=1 zsh'
if [[ $BATTERY -gt 0 ]] ; then
Expand Down Expand Up @@ -1308,17 +1317,6 @@ else
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b${RED}:${YELLOW}%r"
fi

# command not found handling

(( ${COMMAND_NOT_FOUND} == 1 )) &&
function command_not_found_handler() {
emulate -L zsh
if [[ -x ${GRML_ZSH_CNF_HANDLER} ]] ; then
${GRML_ZSH_CNF_HANDLER} $1
fi
return 1
}

# Now for the fun part: The grml prompt themes in `promptsys' mode of operation

# This actually defines three prompts:
Expand Down

0 comments on commit 106f481

Please sign in to comment.