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 z shell. 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.

(Many years later, it's much more refined - 2019/01/28)

You can alternatively view all my dotfiles on github here.

# Variable declaration
ZSH_THEME="pragmata"
HIST_STAMPS="dd.mm.yyyy"
plugins=(git)

# User configuration
export ZSH=$HOME/.oh-my-zsh
source $ZSH/oh-my-zsh.sh
export PATH=/usr/local/bin:$HOME/bin:/usr/local/sbin:$PATH
export LANG=en_US.UTF-8

# Most aliases (There are git aliases in oh-my-zsh)
# Git aliases includes things like `gf` for git fetch, etc
alias ls='exa -GF'
alias rvimtmp='rm -i `find . | grep .swp$`'

# Search recursively for a phrase in all files starting
# in current directory will return file name,line number
# and the line it found the result
search(){
  grep -nr $1 ./
}
# Search recursively for a phrase in all files starting
# in current directory and show results with an extra 
# 3 lines above and below. Will also return file name and
# line numbers for found results
searchDetailed(){
  grep -nrC 3 $1 ./
}
# Search recursively for filenames matching phrase starting
# in current directory. Will return a list of files with their
# directories relative to the search directory
searchFiles(){
  find . -type f -name $1
}
# Show lines of a specified file $3 starting at $1, ending with $2
showLines(){
  sed -n "$1,$2p" $3
}

#Alias for finding process by port and killing it
killPort(){
  lsof -ti tcp:$1 | xargs kill
}

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

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