command_exists () { type "$1" &> /dev/null; } is_linux () { [[ $('uname') == 'Linux' ]]; } is_osx () { [[ $('uname') == 'Darwin' ]] } DISABLE_AUTO_TITLE="true" DISABLE_CORRECTION="false" COMPLETION_WAITING_DOTS="false" source "$HOME/.antigen/antigen.zsh" antigen use oh-my-zsh antigen bundles </dev/null setopt interactivecomments # pound sign in interactive prompt setopt auto_cd autoload -U promptinit && promptinit # echo -ne "\033]12;Green\007" # # Vi mode # bindkey -v # bindkey '^R' history-incremental-pattern-search-backward # bindkey -M viins "\M-." insert-last-word # Allow deleting backwards # http://www.zsh.org/mla/workers/2008/msg01653.html # bindkey -M viins '^?' backward-delete-char # bindkey -M viins '^H' backward-delete-char # 10ms for key sequences KEYTIMEOUT=1 if command_exists 'rvm'; then source /usr/local/rvm/scripts/rvm fi TERM="xterm-256color" SCREEN_COLORS="`tput colors`" if [ -z "$SCREEN_COLORS" ] ; then case "$TERM" in screen-*color-bce) echo "Unknown terminal $TERM. Falling back to 'screen-bce'." export TERM=screen-bce ;; *-88color) echo "Unknown terminal $TERM. Falling back to 'xterm-88color'." export TERM=xterm-88color ;; *-256color) echo "Unknown terminal $TERM. Falling back to 'xterm-256color'." export TERM=xterm-256color ;; esac SCREEN_COLORS=`tput colors` fi if [ -z "$SCREEN_COLORS" ] ; then case "$TERM" in gnome*|xterm*|konsole*|aterm|[Ee]term) echo "Unknown terminal $TERM. Falling back to 'xterm'." export TERM=xterm ;; rxvt*) echo "Unknown terminal $TERM. Falling back to 'rxvt'." export TERM=rxvt ;; screen*) echo "Unknown terminal $TERM. Falling back to 'screen'." export TERM=screen ;; esac SCREEN_COLORS=`tput colors` fi # # Prediction # autoload predict-on # autoload predict-off # zle -N predict-on # zle -N predict-off # bindkey '^X1' predict-on # bindkey '^X2' predict-off export ZSH_PLUGINS_ALIAS_TIPS_TEXT="Alias tip: " AUTOSUGGESTION_HIGHLIGHT_COLOR='fg=magenta' # Remap RAlt to Ctrl setxkbmap -option ctrl:ralt_rctrl source ~/.system_aliases if [ -f ~/.personal_aliases ]; then source ~/.personal_aliases fi alias mcm="make clean && make" export TERM=xterm-256color # eval "$(fasd --init posix-alias zsh-hook)" fasd_cache="$HOME/.fasd-init-bash" if [ "$(command -v fasd)" -nt "$fasd_cache" -o ! -s "$fasd_cache" ]; then eval "$(fasd --init posix-alias zsh-hook zsh-ccomp zsh-ccomp-install zsh-wcomp zsh-wcomp-install)" >| "$fasd_cache" fi source "$fasd_cache" unset fasd_cache # jump to recently used items alias a='fasd -a' # any alias s='fasd -si' # show / search / select alias d='fasd -d' # directory alias f='fasd -f' # file alias z='fasd_cd -d' # cd, same functionality as j in autojump alias zz='fasd_cd -d -i' # interactive directory jump # TMUX Launch alias tmux='tmux -2' function m { if [[ -z $TMUX ]]; then # Attempt to discover a detached session and attach it, else create a new session # CURRENT_USER=$(whoami) TMUX_CON_SESSION=__dev__ if tmux has-session -t $TMUX_CON_SESSION 2>/dev/null; then tmux -2 attach-session -t $TMUX_CON_SESSION else tmux -2 new-session -s $TMUX_CON_SESSION fi else # If inside tmux session then print MOTD MOTD=/etc/motd.tcl if [ -f $MOTD ]; then $MOTD fi fi }