mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge branch 'master' into theming
Conflicts: templates/zshrc.arch-zsh-template templates/zshrc.zsh-template
This commit is contained in:
commit
8b5d590249
3 changed files with 22 additions and 1 deletions
20
lib/notfound.zsh
Normal file
20
lib/notfound.zsh
Normal file
|
|
@ -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
|
||||
|
|
@ -7,3 +7,5 @@ random_theme() {
|
|||
themes=($ZSH/themes/*zsh-theme)
|
||||
source "$themes[$RANDOM%$#themes+1]"
|
||||
}
|
||||
|
||||
compdef "_files -g '*.zsh'" set_theme
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue