5 # ls, the common ones I use a lot shortened for rapid fire usage
6 alias l='ls -lFh' #size,show type,human readable
7 alias la='ls -lAFh' #long list,show almost all,show type,human readable
8 alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
9 alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
10 alias ll='ls -l' #long list
11 alias ldot='ls -ld .*'
13 alias lart='ls -1Fcart'
15 alias lsr='ls -lARFh' #Recursive list of files and directories
16 alias lsn='ls -1' #A column contains name of files and directories
18 alias zshrc='${=EDITOR} ${ZDOTDIR:-$HOME}/.zshrc' # Quick access to the .zshrc file
20 alias grep='grep --color'
21 alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
25 # Command line head / tail shortcuts
31 alias -g LL="2>&1 | less"
32 alias -g CA="2>&1 | cat -A"
33 alias -g NE="2> /dev/null"
34 alias -g NUL="> /dev/null 2>&1"
35 alias -g P="2>&1| pygmentize -l pytb"
37 alias dud='du -d 1 -h'
38 (( $+commands[duf] )) || alias duf='du -sh *'
39 (( $+commands[fd] )) || alias fd='find . -type d -name'
40 alias ff='find . -type f -name'
43 alias hgrep="fc -El 0 | grep"
46 alias sortnr='sort -n -r'
47 alias unexport='unset'
53 # zsh is able to auto-do some kungfoo
54 # depends on the SUFFIX :)
55 autoload -Uz is-at-least
56 if is-at-least 4.2.0; then
57 # open browser on urls
58 if [[ -n "$BROWSER" ]]; then
59 _browser_fts=(htm html de org net com at cx nl se dk)
60 for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
63 _editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
64 for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done
66 if [[ -n "$XIVIEWER" ]]; then
67 _image_fts=(jpg jpeg png gif mng tiff tif xpm)
68 for ft in $_image_fts; do alias -s $ft='$XIVIEWER'; done
71 _media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
72 for ft in $_media_fts; do alias -s $ft=mplayer; done
81 #list whats inside packed file
82 alias -s zip="unzip -l"
83 alias -s rar="unrar l"
85 alias -s tar.gz="echo "
86 alias -s ace="unace l"
89 # Make zsh know about hosts already accessed by SSH
90 zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'