From 2b02230c5fb24815f107068bd15a5dbc1b46ef64 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Tue, 5 Mar 2013 15:15:00 +0100 Subject: [PATCH] zshrc: Move CNF handler to a better place Signed-off-by: Frank Terbeck --- etc/zsh/zshrc | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 355a944..7d23055 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -985,6 +985,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 :(' @@ -1240,8 +1251,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 @@ -1307,17 +1316,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: -- 2.1.4