public
Created

zsh config

  • Download Gist
.zshrc
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
# Path to your oh-my-zsh configuration.
ZSH=$HOME/v/oh-my-zsh
 
# Set name of the theme to load.
ZSH_THEME="mgutz"
 
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
 
# Comment this out to disable weekly auto-update checks
DISABLE_AUTO_UPDATE="true"
 
# Uncomment following line if you want to disable colors in ls
DISABLE_LS_COLORS="true"
 
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
 
# Uncomment following line if you want red dots to be displayed while waiting for completion
COMPLETION_WAITING_DOTS="true"
 
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git deb debian history-substring-search)
 
source $ZSH/oh-my-zsh.sh
 
setopt nohup #don't kill jobs when logout
setopt nocheckjobs #and do it silently :)
 
#Home Path Bin // shell scripts and such
PATH=$PATH:$HOME/bin
PATH=/usr/local/Cellar/ruby/1.9.3-p194/bin:$PATH
PATH=/opt/local/bin:/opt/local/sbin:$PATH
PATH=/usr/local/mysql/bin/:$PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
 
 
# Customize to your needs...
#
# -font -*-fixed-medium-r-*-*-18-*-*-*-*-*-iso8859-* -geometry 70x24
 
#------------------------------------------////
# Basic Configuration:
#------------------------------------------////
#kill the beep alarm
#setopt no_beep
 
#enable auto-correct
#setopt correctall
unsetopt correct_all
 
#turn on tab completion and make it fancy
#autoload -U compinit && compinit
#zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
#zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'
 
#fancy colors and prompts are set later
#add custom functions to path (important for prompt)
fpath=(~/.zsh/functions $fpath)
 
#remove right prompt after command is run (helpful if copying and pasting)
#setopt TRANSIENT_RPROMPT
#------------------------------------------////
# Colors:
#------------------------------------------////
black='\e[0;30m'
blue='\e[0;34m'
green='\e[0;32m'
cyan='\e[0;36m'
red='\e[0;31m'
purple='\e[0;35m'
brown='\e[0;33m'
lightgray='\e[0;37m'
darkgray='\e[1;30m'
lightblue='\e[1;34m'
lightgreen='\e[1;32m'
lightcyan='\e[1;36m'
lightred='\e[1;31m'
lightpurple='\e[1;35m'
yellow='\e[1;33m'
white='\e[1;37m'
nc='\e[0m'
 
#Colors for less pager (man pages)
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_so=$'\E[38;5;246m' # begin standout-mode - info box
export LESS_TERMCAP_ue=$'\E[0m' # end underline
export LESS_TERMCAP_us=$'\E[04;38;5;146m' # begin underline
 
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
# alias ls='ls --color=auto'
# alias dir='dir --color=auto'
# alias vdir='vdir --color=auto'
 
# alias grep='grep --color=auto'
# alias fgrep='fgrep --color=auto'
# alias egrep='egrep --color=auto'
fi
 
#------------------------------------------////
# Custom Prompt:
#------------------------------------------////
# Nice basic prompt
#export PS1="%n@%m:%~%# "
#export RPS1=" <%T"
#export PS2="%_> "
 
# Colorful basic prompt option 1
#autoload -U colors && colors
#export PS1="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% "
#export RPS1="%{$fg[cyan]%}<%T%{$reset_color%}"
#export PS2="%_> "
 
# Colorful basic prompt option 2 { Better than option 1 }
#export PS1=$'%{\e[1;32m%}%n%{\e[0m%}%{\e[1;34m%}@%{\e[1;31m%}%m %{\e[1;34m%}%~ %{\e[0m%}%% '
#export RPS1=$'%{\e[1;30m%}<%T%{\e[0m%}'
#export PS2=$'%{\e[0;37m%} %_>%{\e[0m%} '
 
# Fancy prompt system see /usr/share/zsh/functions/Prompts/ for files
# the "fhsm" configuration is loaded from ~/.zsh/functions, which is added to the path above.
# List options with: prompt -l
autoload -U promptinit && promptinit
#prompt fhsm
 
 
#------------------------------------------////
# Aliases:
#------------------------------------------////
# Useful aliases (building on the color enablers)
alias ll='ls -l'
alias la='ls -Al'
alias lb='ls -Al --block-size=1MB'
alias reload='source ~/.zshrc'
alias biggest='BLOCKSIZE=1048576; du -x | sort -nr | head -10'
 
# Shortcuts
alias home='cd ~/'
alias documents='cd ~/documents'
alias downloads='cd ~/Downloads'
alias images='cd ~/images'
alias videos='cd ~/videos'
 
## Sudo fixes
alias install='~/bin/install_and_log install'
alias remove='sudo apt-get remove'
alias update='sudo apt-get update'
alias upgrade='sudo apt-get update && sudo apt-get upgrade'
alias dist-upgrade='sudo apt-get update && sudo apt-get dist-upgrade'
alias orphand='sudo deborphan | xargs sudo apt-get -y remove --purge'
alias cleanup='sudo apt-get autoclean && sudo apt-get autoremove && sudo apt-get clean && sudo apt-get remove && orphand'
alias search="apt-cache search"
 
#git
alias gitconf='git config branch.master.remote origin;git config branch.master.merge refs/heads/master'
 
##Info
alias stamp='date "+%Y-%m-%d %a %H:%M"'
alias da='date "+%Y-%m-%d %A %T %Z"'
 
#------------------------------------------////
# Custom Extract / Compress:
#------------------------------------------////
# Easy extract
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
 
# Creates an archive from given directory
mktar() { tar cvf "${1%%/}.tar" "${1%%/}/"; }
mktgz() { tar cvzf "${1%%/}.tar.gz" "${1%%/}/"; }
mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }
 
#------------------------------------------////
# Other Custom Functions:
#------------------------------------------////
upinfo ()
{
echo -ne "\t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
}
 
 
#------------------------------------------////
# Welcome Info:
#------------------------------------------////
echo -ne "${red}Today is:\t\t${cyan}" `date`; echo ""
echo -e "${red}Kernel Information: \t${cyan}" `uname -smr`
 
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.