From aa1d7ad0125a0f15831affffac551cc830d7e104 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 10:23:29 -0500 Subject: [PATCH 1/3] Why the hell does oh-my-zsh have an .sh extension and not .zsh? Conflicts: templates/zshrc.arch-zsh-template --- oh-my-zsh.sh => oh-my-zsh.zsh | 0 templates/zshrc.zsh-template | 2 +- tools/theme_chooser.sh | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename oh-my-zsh.sh => oh-my-zsh.zsh (100%) diff --git a/oh-my-zsh.sh b/oh-my-zsh.zsh similarity index 100% rename from oh-my-zsh.sh rename to oh-my-zsh.zsh diff --git a/templates/zshrc.zsh-template b/templates/zshrc.zsh-template index 1ab40aba6..f422f89b2 100644 --- a/templates/zshrc.zsh-template +++ b/templates/zshrc.zsh-template @@ -26,6 +26,6 @@ ZSH_THEME="robbyrussell" # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(git) -source $ZSH/oh-my-zsh.sh +source $ZSH/oh-my-zsh.zsh # Customize to your needs... diff --git a/tools/theme_chooser.sh b/tools/theme_chooser.sh index 4d7047444..cbf0f6d53 100755 --- a/tools/theme_chooser.sh +++ b/tools/theme_chooser.sh @@ -9,7 +9,7 @@ THEMES_DIR="$ZSH/themes" FAVLIST="${HOME}/.zsh_favlist" -source $ZSH/oh-my-zsh.sh +source $ZSH/oh-my-zsh.zsh function noyes() { read "a?$1 [y/N] " From f755d3d538a820f3240b220160c7aff3cba2829a Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 10:27:32 -0500 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0,=20arch-zsh-template?= =?UTF-8?q?=20needs=20to=20source=20oh-my-zsh.zsh...=20How=20did=20I=20mes?= =?UTF-8?q?s=20this=20up=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/zshrc.arch-zsh-template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/zshrc.arch-zsh-template b/templates/zshrc.arch-zsh-template index 27f4d2e09..1fe66bf29 100644 --- a/templates/zshrc.arch-zsh-template +++ b/templates/zshrc.arch-zsh-template @@ -27,7 +27,7 @@ DISABLE_AUTO_UPDATE="true" plugins=(git) load_oh_my_zshell(){ - source $ZSH/oh-my-zsh.sh + source $ZSH/oh-my-zsh.zsh } # Customize to your needs... From 3fb01c95317bd64a9fb2f15bedb048af886f2e2f Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Mon, 28 Nov 2011 12:17:02 -0500 Subject: [PATCH 3/3] If pkgfile is installed, add a "command not found" hook. This hook is of better quality than the one that's pre-packaged with pkgtools (it won't run when a command is part of a pipe or subshell). I should see about getting this hook accepted in pkgtools. --- lib/notfound.zsh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lib/notfound.zsh diff --git a/lib/notfound.zsh b/lib/notfound.zsh new file mode 100644 index 000000000..6a2afb5e9 --- /dev/null +++ b/lib/notfound.zsh @@ -0,0 +1,20 @@ +if [[ -x /usr/bin/pkgfile ]]; then + command_not_found_handler() { + local pkg p + local pid ppid pgrp session tty_nr tpgid + + # double check pkgfile exists + [[ ! -x /usr/bin/pkgfile ]] && return 127 + + # do not run when within a pipe or subshell + [[ ! -t 1 ]] && return 127 + read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat + [[ $$ -eq $tpgid ]] && return 127 + + pkg=$(pkgfile -b -v -- $1) + if [[ -z $pkg ]] && return 127 + + echo "The command \"$1\" can be found in the following packages:" + for p in $pkg; echo " $p" + } +fi