139 lines
4.7 KiB
Bash
139 lines
4.7 KiB
Bash
# The following lines were added by compinstall
|
|
|
|
zstyle ':completion:*' completer _expand _complete _ignored _approximate
|
|
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-_]=** r:|=**' ''
|
|
zstyle :compinstall filename '/Users/sidharta/.zshrc'
|
|
|
|
autoload -Uz compinit
|
|
compinit
|
|
# End of lines added by compinstall
|
|
# Lines configured by zsh-newuser-install
|
|
HISTFILE=~/.zsh_history
|
|
HISTSIZE=1000
|
|
SAVEHIST=1000
|
|
setopt appendhistory autocd extendedglob nomatch notify
|
|
bindkey -e
|
|
# End of lines configured by zsh-newuser-install
|
|
|
|
export PATH=$PATH:/opt/local/bin:/usr/local/lib/io:~/.cabal/bin
|
|
export MANPATH=$MANPATH:/opt/local/share/man
|
|
export INFOPATH=$INFOPATH:/opt/local/share/info
|
|
export PYTHONSTARTUP=~/.pythonrc
|
|
export TERM=rxvt
|
|
alias gcc="gcc-mp-4.9"
|
|
alias g++="g++-mp-4.9"
|
|
alias qmake4="/opt/local/bin/qmake"
|
|
alias qmake="/usr/local/Qt-5.3.0/bin/qmake"
|
|
alias python="python3.3"
|
|
alias cdtan="cd ~/Documents/Code/Github/Detanglement/src"
|
|
alias cdpy="cd ~/Documents/Code/Github/AudioPython"
|
|
alias cdpc="cd ~/Documents/Code/PrivCode/"
|
|
alias cdl="cd ~/Documents/Code/LiveCodingEditor"
|
|
alias cdg="cd ~/Documents/Code/Github"
|
|
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
|
|
alias dud="du -d 1"
|
|
alias loc="cloc *"
|
|
alias ls="ls -a"
|
|
PROMPT="[%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg_no_bold[yellow]%}%1~%{$reset_color%}]\$"
|
|
|
|
expand-or-complete-with-dots(){
|
|
echo -n "e[31m.....\e[0m"
|
|
zle expand-or-complete
|
|
zle redisplay
|
|
}
|
|
zle -N expand-or-complete-with-dots
|
|
bindkey "Î" expand-or-complete-with-dots
|
|
|
|
insert_sudo () {
|
|
zle beginning-of-line; zle -U "sudo "
|
|
}
|
|
zle -N insert-sudo insert_sudo
|
|
bindkey "^[s" insert-sudo
|
|
|
|
case $TERM in
|
|
xterm*)
|
|
precmd(){print -Pn "\e]0;%m: %~\a"}
|
|
ssh(){
|
|
PRENAME="`dcop $KONSOLE_DCOP_SESSION sessionName`";
|
|
dcop "$KONSOLE_DCOP_SESSION" renameSession "$@";
|
|
/usr/bin/ssh "$@";
|
|
dcop "$KONSOLE_DCOP_SESSION" renameSession "$PRENAME"
|
|
} ;;
|
|
esac
|
|
|
|
extract(){
|
|
if [ -f $1 ] ; then
|
|
case $1 in
|
|
*.tar.bz2) tar xjf $1 ;;
|
|
*.tar.gz) tar xzf $1 ;;
|
|
*.tar.xz) tar xzf $1 ;;
|
|
*.bz2) bunzip2 $1 ;;
|
|
*.rar) rar x $1 ;;
|
|
*.gz) gunzip $1 ;;
|
|
*.tar) tar xf $1 ;;
|
|
*.tbz2) tar xjf $1 ;;
|
|
*.tgz) tar xzf $1 ;;
|
|
*.zip) if [ -n $2 ] ; then
|
|
unzip $1 -d $2
|
|
else
|
|
unzip $1
|
|
fi;;
|
|
*.Z) uncompress $1 ;;
|
|
*.7z) 7z x $1 ;;
|
|
*) echo "'$1' cannot be extracted via extract()" ;;
|
|
esac
|
|
else
|
|
echo "'$1' is not a valid file"
|
|
fi
|
|
}
|
|
|
|
netinfo(){
|
|
echo "--------------- Network Information ---------------"
|
|
/sbin/ifconfig | awk /'inet addr/ {print $2}'
|
|
/sbin/ifconfig | awk /'Bcast/ {print $3}'
|
|
/sbin/ifconfig | awk /'inet addr/ {print $4}'
|
|
/sbin/ifconfig | awk /'HWaddr/ {print $4,$5}'
|
|
myip=`lynx -dump -hiddenlinks=ignore -nolist http://checkip.dyndns.org:8245/ | sed '/^$/d; s/^[ ]*//g; s/[ ]*$//g' `
|
|
echo "${myip}"
|
|
echo "---------------------------------------------------"
|
|
}
|
|
|
|
pinfo(){
|
|
top -pid `pgrep $1 | tr "\\n" "," | sed 's/,$//' | sed -e's/,/ -pid /g'`
|
|
}
|
|
|
|
update(){
|
|
autoload -U colors && colors
|
|
yellow=$fg_no_bold[yellow]
|
|
none=$reset_color
|
|
if [[ $1 == '-v' ]] ; then
|
|
echo -e "${yellow}Updating homebrew formulae${none}"
|
|
brew update
|
|
echo -e "${yellow}Updating installed sources(Homebrew)${none}"
|
|
brew upgrade outdated
|
|
echo -e "${yellow}Updating MacPorts (sudo required)${none}"
|
|
sudo port selfupdate
|
|
echo -e "${yellow}Updating installed sources(MacPorts)${none}"
|
|
sudo port upgrade outdated
|
|
else
|
|
echo -e "${yellow}Updating homebrew formulae${none}"
|
|
brew update &> /dev/null
|
|
echo -e "${yellow}Updating installed sources(Homebrew)${none}"
|
|
brew upgrade outdated &> /dev/null
|
|
echo -e "${yellow}Updating MacPorts (sudo required)${none}"
|
|
sudo port selfupdate &> /dev/null
|
|
echo -e "${yellow}Updating installed sources(MacPorts)${none}"
|
|
sudo port upgrade outdated &> /dev/null
|
|
fi
|
|
}
|
|
|
|
save_dotfiles(){
|
|
cp ~/.bash_profile ~/Documents/Code/Github/.dotfiles/bash_profile
|
|
cp ~/.ghci ~/Documents/Code/Github/.dotfiles/ghci
|
|
cp ~/.gitignore ~/Documents/Code/Github/.dotfiles/gitignore
|
|
cp ~/.gitconfig ~/Documents/Code/Github/.dotfiles/gitconfig
|
|
cp ~/.pythonrc ~/Documents/Code/Github/.dotfiles/pythonrc
|
|
cp ~/.vimrc ~/Documents/Code/Github/.dotfiles/vimrc
|
|
cp ~/.zshrc ~/Documents/Code/Github/.dotfiles/zshrc
|
|
}
|