mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-01 04:30:37 +02:00
PHP can be executed as CLI script but due to the automated attempt to add browser support to that extension such ability is prevented in certain circumstances.
121 lines
3.1 KiB
Bash
121 lines
3.1 KiB
Bash
# Advanced Aliases.
|
||
# Use with caution
|
||
|
||
|
||
# Basic directory operations
|
||
#alias ..='cd ..'
|
||
#alias ...='cd ../..'
|
||
#alias ....='cd ../../..'
|
||
#alias .....='cd ../../../..'
|
||
alias -- -='cd -'
|
||
alias cd/='cd /'
|
||
|
||
alias cd..='cd ..'
|
||
alias cd...='cd ../..'
|
||
alias cd....='cd ../../..'
|
||
alias cd.....='cd ../../../..'
|
||
|
||
# ls, the common ones I use a lot shortened for rapid fire usage
|
||
# alias ls='ls --color' # I like color
|
||
alias l='ls -lFh' # size,show type,human readable
|
||
alias la='ls -lAFh' # long list,show almost all,show type,human readable
|
||
alias lr='ls -tRFh' # sorted by date,recursive,show type,human readable
|
||
alias lt='ls -ltFh' # long list,sorted by date,show type,human readable
|
||
alias ll='ls -l' # long list
|
||
alias lla='la' # long list
|
||
alias llR='ls -lhR'
|
||
alias l='la' # long list
|
||
alias lsa='ls -lah'
|
||
alias sl=ls # often screw this up
|
||
|
||
alias sudo='sudo ' # This allow 'sudo ll'. See http://www.shellperson.net/using-sudo-with-an-alias/
|
||
|
||
alias ldot='ls -ld .*'
|
||
alias lS='ls -1FSsh'
|
||
alias lart='ls -1Fcart'
|
||
alias lrt='ls -1Fcrt'
|
||
|
||
alias zshrc='$EDITOR ~/.zshrc' # Quick access to the ~/.zshrc file
|
||
|
||
alias grep='grep --color'
|
||
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} '
|
||
|
||
alias t='tail -f'
|
||
|
||
# Command line head / tail shortcuts
|
||
alias -g H='| head'
|
||
alias -g T='| tail'
|
||
alias -g G='| grep'
|
||
alias -g L="| less"
|
||
alias -g M="| most"
|
||
alias -g LL="2>&1 | less"
|
||
alias -g CA="2>&1 | cat -A"
|
||
alias -g NE="2> /dev/null"
|
||
alias -g NUL="> /dev/null 2>&1"
|
||
alias -g P="2>&1| pygmentize -l pytb"
|
||
|
||
alias dud='du -d 1 -h'
|
||
alias duf='du -sh *'
|
||
alias fd='find . -type d -name'
|
||
alias ff='find . -type f -name'
|
||
|
||
alias h='history'
|
||
alias hgrep="fc -El 0 | grep"
|
||
alias help='man'
|
||
alias p='ps -f'
|
||
alias sortnr='sort -n -r'
|
||
alias unexport='unset'
|
||
|
||
alias whereami=display_info
|
||
|
||
alias week='date +%V'
|
||
alias hexdump='hexdump -C'
|
||
|
||
alias rm='rm -i'
|
||
alias cp='cp -i'
|
||
alias mv='mv -i'
|
||
|
||
alias saguagu="sudo apt-get update && sudo apt-get upgrade"
|
||
|
||
# Use Git’s colored diff when available
|
||
hash git &>/dev/null
|
||
if [ $? -eq 0 ]; then
|
||
function sdiff() {
|
||
git diff --no-index --color-words "$@"
|
||
}
|
||
fi
|
||
|
||
# zsh is able to auto-do some kungfoo
|
||
# depends on the SUFFIX :)
|
||
if is-at-least 4.2.0; then
|
||
# open browser on urls
|
||
_browser_fts=(htm html de org net com at cx nl se dk dk)
|
||
for ft in $_browser_fts ; do alias -s $ft=$BROWSER ; done
|
||
|
||
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
|
||
for ft in $_editor_fts ; do alias -s $ft=$EDITOR ; done
|
||
|
||
_image_fts=(jpg jpeg png gif mng tiff tif xpm)
|
||
for ft in $_image_fts ; do alias -s $ft=$XIVIEWER; done
|
||
|
||
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
|
||
for ft in $_media_fts ; do alias -s $ft=mplayer ; done
|
||
|
||
#read documents
|
||
alias -s pdf=acroread
|
||
alias -s ps=gv
|
||
alias -s dvi=xdvi
|
||
alias -s chm=xchm
|
||
alias -s djvu=djview
|
||
|
||
#list whats inside packed file
|
||
alias -s zip="unzip -l"
|
||
alias -s rar="unrar l"
|
||
alias -s tar="tar tf"
|
||
alias -s tar.gz="echo "
|
||
alias -s ace="unace l"
|
||
fi
|
||
|
||
# Make zsh know about hosts already accessed by SSH
|
||
zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })'
|
||
|