Skip to content

Instantly share code, notes, and snippets.

@itolosa
Created August 15, 2018 22:55
Show Gist options
  • Save itolosa/3853b3c8fd5536977ccdecb157a03c55 to your computer and use it in GitHub Desktop.
Save itolosa/3853b3c8fd5536977ccdecb157a03c55 to your computer and use it in GitHub Desktop.
nuevo zshrc
#xrandr --output LVDS1 --gamma 1.24:1.36:1.45 --brightness 0.9
ZSH=$HOME/.oh-my-zsh
ZSH_THEME="pygmalion"
export UPDATE_ZSH_DAYS=14
CASE_SENSITIVE="false"
DISABLE_AUTO_TITLE="true"
COMPLETION_WAITING_DOTS="true"
export default_rails_env=development
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export RUBY_GC_MALLOC_LIMIT=1073741824
export RUBY_GC_HEAP_FREE_SLOTS=524288
export RUBY_GC_HEAP_INIT_SLOTS=65536
plugins=(bundler autojump ruby rails brew gem pip python osx urltools cap zsh-completions)
source $ZSH/oh-my-zsh.sh
export PATH=/usr/local/heroku/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/npm/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH
export VISUAL='vim'
export EDITOR='vim'
export GIT_EDITOR='vim'
export LS_OPTIONS='-G';
alias rm="rm -i"
alias irb="irb -rubygems"
alias whatip="curl ipecho.net/plain; echo"
alias www='python -m SimpleHTTPServer 8000'
alias scpresume="rsync --partial --progress --rsh=ssh"
alias gitgraph="git log --graph --pretty=oneline --abbrev-commit"
alias dirsize="for dir in *;do if [ -d \$dir ]; then du -hsL \$dir; fi; done"
alias bfg="java -jar $HOME/.bfg/bfg.jar"
#alias iphone="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator"
alias brc="bundle exec rails console"
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# Lock the screen (when going AFK)
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
# Reload the shell (i.e. invoke as a login shell)
alias reload="exec $SHELL -l"
# Disable Spotlight
alias spotoff="sudo mdutil -a -i off"
# Enable Spotlight
alias spoton="sudo mdutil -a -i on"
# URL-encode strings
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
# Enable aliases to be sudo’ed
alias sudo='sudo '
# Always enable colored `grep` output
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
else # OS X `ls`
colorflag="-G"
fi
# don't expand aliases _before_ completion has finished
# like: git comm-[tab]
setopt complete_aliases
setopt NO_BG_NICE # don't nice background tasks
setopt NO_HUP
setopt NO_LIST_BEEP
setopt LOCAL_OPTIONS # allow functions to have local options
setopt LOCAL_TRAPS # allow functions to have local traps
setopt HIST_VERIFY
setopt SHARE_HISTORY # share history between sessions ???
setopt EXTENDED_HISTORY # add timestamps to history
setopt PROMPT_SUBST
setopt CORRECT
setopt COMPLETE_IN_WORD
setopt IGNORE_EOF
setopt APPEND_HISTORY # adds history
setopt INC_APPEND_HISTORY SHARE_HISTORY # adds history incrementally and share it across sessions
setopt HIST_IGNORE_ALL_DUPS # don't record dupes in history
setopt HIST_REDUCE_BLANKS
extract () {
if [ -f $1 ]; then
case $1 in
*.tar.bz2) tar -jxvf $1 ;;
*.tar.gz) tar -zxvf $1 ;;
*.bz2) bunzip2 $1 ;;
*.dmg) hdiutil mount $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar -xvf $1 ;;
*.tbz2) tar -jxvf $1 ;;
*.tgz) tar -zxvf $1 ;;
*.zip) unzip $1 ;;
*.ZIP) unzip $1 ;;
*.pax) cat $1 | pax -r ;;
*.pax.Z) uncompress $1 --stdout | pax -r ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted/mounted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# From http://dotfiles.org/~_why/.zshrc
# Sets the window title nicely no matter where you are
function title() {
# escape '%' chars in $1, make nonprintables visible
a=${(V)1//\%/\%\%}
# Truncate command, and join lines.
a=$(print -Pn "%40>...>$a" | tr -d "\n")
case $TERM in
screen)
print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
;;
xterm*|rxvt)
print -Pn "\e]2;$2\a" # plain xterm title ($3 for pwd)
;;
esac
}
# Like pgrep, just in case.
psg() {
if [ ! -z $1 ] ; then
echo "Grepping for processes matching $1..."
ps aux | grep -i $1 | grep -v grep
else
echo "!! Need name to grep for"
fi
}
export PATH=$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH
export PATH=$HOME/.myscripts/bin:$PATH
if command -v rbenv 2> /dev/null; then eval "$(rbenv init - --no-rehash)"; fi
export PATH="/usr/local/heroku/bin:$PATH"
#exprt PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH"
#export PATH="$HOME/bin:$PATH"
#eval `dircolors $HOME/.dircolors-themes/dircolors.ansi-light`
export PATH="$HOME/.astyle/bin:$PATH"
export ANSIBLE_HOSTS=/etc/ansible/hosts
setopt AUTO_PUSHD
autoload -U compinit && compinit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment