Source

castle-zundr-dotfiles / home / .zshrc

# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
ZSH_CUSTOM=$HOME/.zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="candy"

# Example aliases
alias zshconfig="vim ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

# 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="false"

# 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/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git mercurial perl python battery ant ssh-agent vi-mode history-substring-search)
case $(uname) in
  Darwin)
    plugins=($plugins osx brew iterm2 )
    ;;
  Linux)
    plugins=($plugins )
    ;;
esac

# plugin config
zstyle :omz:plugins:ssh-agent agent-forwarding on

# load oh-my-zsh
source $ZSH/oh-my-zsh.sh

# disable autocorrection
unsetopt correct_all

# set ssh socket if there
if [ -S /tmp/ssh-agent-$USER-screen ]; then
  export SSH_AUTH_SOCK=/tmp/ssh-agent-$USER-screen
fi

# Customize to your needs...
export PATH=$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

# Tuenti setup
export TUENTI_TOOLS=/usr/lib/tuenti_tools
if test -d "$TUENTI_TOOLS"
then
  export TUENTI_TOOLS
  export TUENTI_TOOLS_PATH=$TUENTI_TOOLS
  export PATH=$PATH:$TUENTI_TOOLS/bin:$TUENTI_TOOLS/mercurial/bin:$TUENTI_TOOLS/mercurial/tu-hg-workbench/bin

  source $TUENTI_TOOLS/env/aliases
  #source $TUENTI_TOOLS/env/bash_completion
  #source $TUENTI_TOOLS/env/keyring
  source $TUENTI_TOOLS/env/profile

  if test -d /Volumes/Dev/branches
  then
    alias branches='/Volumes/Dev/branches'
  fi
fi

# Color listing
eval $(dircolors ~/.dircolors)
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"

# Colourful less
export LESS='FSRX'

# List direcory contents
export LS_OPTIONS='--color'
alias ls='ls $LS_OPTIONS'
alias l='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -lh'
alias lll='ls $LS_OPTIONS -alh'
alias sl='ls $LS_OPTIONS' # often screw this up

# utility functions
function tj() {
  local cmd=":tj $1<CR>:call foreground()<CR>"
  if [ -z $(mvim --serverlist) ]; then
    mvim +"$cmd"
  else
    mvim --remote-send "$cmd"
  fi
}

# load .Xdefaults if X11
test -n "$DISPLAY" && (which xrdb >/dev/null 2>&1) && xrdb -merge ~/.Xdefaults

# keyring daemon
case $(hostname) in
  shironeko)
    #export $(gnome-keyring-daemon --start)
    ;;
esac

# if not running under tmux, try to attach tmux session, if any
if [ -z "$TMUX" -a -n "$DISPLAY" ]; then
  if (tmux has-session 2>/dev/null); then
    exec tmux attach-session
  else
    exec tmux new
  fi
fi

# set 256 color xterm
if [ "$TERM" = "xterm" ]; then
  export TERM=xterm-256color
fi