.zshrc

.zshrc

It all started one long rainy night after setting down my Archlinux laptop and picking up my macbook pro.. inevitably annoyed quickly by the ancient bash version. Switched to zshell. Downloaded oh-my-zsh for a prettiness template to start with.. customized my own theme, and have been hooked for a solid 3 months so far.

# Variable declaration
ZSH_THEME="powerlevel9k/powerlevel9k"  
HIST_STAMPS="dd.mm.yyyy"  
POWERLEVEL9K_PROMPT_ON_NEWLINE=true  
plugins=(git)

# User configuration
export ZSH=/Users/nateinman/.oh-my-zsh  
source $ZSH/oh-my-zsh.sh  
export LANG=en_US.UTF-8  
export PATH=/usr/local/share/npm/lib/node_modules/grunt-cli/bin:$PATH  
export PATH=~/.composer/vendor/bin:$PATH  
export PATH=$(brew --prefix php56)/bin:$PATH  
export PATH=$(brew --prefix vim)/bin:$PATH  
export RBENV_ROOT=/usr/local/var/rbenv  
export webroot=/Library/WebServer/Documents/

# shims for rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

# Preferred editor for local and remote sessions
if [[ -n $SSH_CONNECTION ]]; then  
  export EDITOR='vim'
else  
  export EDITOR='mvim'
fi

# All aliases 
alias ls='ls -GFh'  
alias t='tree -phCL 2'  
alias chrome="open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --disable-web-security" "$1"

# Alias grep command for search
search(){  
  grep -nr $1 ./
}

# Make it easy to test npm packages
link(){  
  npm uninstall -g $1
  npm unlink $1
  npm link $1
}

# Create a directory and cd into it
walk(){  
  mkdir -p $1
  cd $1
}

# Recursively remove all contents of a directory
close(){  
  if [ -n "$1" ]; then
    rm -rf $1  
  else
    rm -rf -- "$(pwd -P)" && cd ..
  fi
}

# Download and extract url zip 
czip(){  
  curl -sS $1 > file.zip
  unzip file.zip
  rm file.zip
}

# Pretty print json files
pjson(){  
  cat $1 | underscore print --color
}

# Output json files pretty formatted
ojson(){  
  cat $1 | underscore print > $2
}

# Automatically download the latest pip and install it
getPip(){  
  curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python
}

About Nathaniel Inman

I'm a gamer, graphic designer, musician and software engineer. C++ and Javascript are my favorite two programming languages for which I develop exclusively in vim, tmux and zsh on Arch Linux.

Kansas City, Missouri http://www.theoestudio.com