mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
helpfile
This commit is contained in:
parent
1f6b422a42
commit
6904374475
2 changed files with 78 additions and 0 deletions
14
colors
Normal file
14
colors
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Less colors
|
||||
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking
|
||||
export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold
|
||||
export LESS_TERMCAP_me=$'\E[0m' # end mode
|
||||
export LESS_TERMCAP_se=$'\E[0m' # end standout-mode
|
||||
export LESS_TERMCAP_ue=$'\E[0m' # end underline
|
||||
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
|
||||
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box (This stops hilighting from working properly.)
|
||||
|
||||
if [[ -x `which lesspipe.sh` ]]; then
|
||||
export LESS="-R -M --shift 5"
|
||||
export LESSOPEN="|lesspipe.sh %s"
|
||||
export LESSCOLOR=1
|
||||
fi
|
||||
64
help
Normal file
64
help
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# From https://raw.github.com/mattfoster/zshkit/master/03_help
|
||||
# See From Bash to Z Shell, Page: 101
|
||||
if [[ $(whence -v run-help) == 'run-help is a shell function' ]]; then
|
||||
unalias run-help
|
||||
fi
|
||||
autoload -Uz run-help
|
||||
# From zsh-helpfiles (see fink)
|
||||
alias help=run-help
|
||||
|
||||
# From zsh-lovers
|
||||
# Function Usage: doc packagename
|
||||
|
||||
# We can only easily use one documentation directory, so
|
||||
# these are in priority order
|
||||
docdirs=(/sw/share/doc /usr/local/share/doc /usr/share/doc)
|
||||
|
||||
foreach dir ($docdirs) {
|
||||
if [[ -d $dir ]] then
|
||||
doc() { cd $dir/$1 && ls }
|
||||
gdoc() { cd $dir/$1 && $EDITOR . }
|
||||
_doc() { _files -W $dir -/ }
|
||||
break
|
||||
fi
|
||||
}
|
||||
|
||||
# provide useful information on globbing
|
||||
H-Glob() {
|
||||
echo -e "
|
||||
/ directories
|
||||
. plain files
|
||||
@ symbolic links
|
||||
= sockets
|
||||
p named pipes (FIFOs)
|
||||
* executable plain files (0100)
|
||||
% device files (character or block special)
|
||||
%b block special files
|
||||
%c character special files
|
||||
r owner-readable files (0400)
|
||||
w owner-writable files (0200)
|
||||
x owner-executable files (0100)
|
||||
A group-readable files (0040)
|
||||
I group-writable files (0020)
|
||||
E group-executable files (0010)
|
||||
R world-readable files (0004)
|
||||
W world-writable files (0002)
|
||||
X world-executable files (0001)
|
||||
s setuid files (04000)
|
||||
S setgid files (02000)
|
||||
t files with the sticky bit (01000)
|
||||
print *(m-1) # List files modified today.
|
||||
print *(a1) # List files accessed one day ago.
|
||||
print *(@) # Print links.
|
||||
print *(Lk+50) # List files > 50 Kilobytes.
|
||||
print *(Lk-50) # List files < 50 Kilobytes.
|
||||
print **/*.c # Recursively list all c files.
|
||||
print **/*.c~file.c # List all c files, except file.c
|
||||
print (foo|bar).* # List files whos names start foo or bar.
|
||||
print *~*.* #
|
||||
chmod 644 *(.^x) # make all non-executable files publically readable
|
||||
print -l *(.c|.h) # List all c and header files on their own lines.
|
||||
print **/*(g:users:) # Recursively list files with the group 'users'
|
||||
echo /proc/*/cwd(:h:t:s/self//) # Analogue of >ps ax | awk '{print $1}'<"
|
||||
}
|
||||
# vim: set syn=zsh:
|
||||
Loading…
Add table
Add a link
Reference in a new issue