zshrc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. HISTFILE=~/.histfile
  2. HISTSIZE=1000
  3. SAVEHIST=1000
  4. setopt incappendhistory nomatch correct NO_HUP
  5. unsetopt beep
  6. bindkey -v
  7. zstyle :compinstall filename '/Users/drew/.zshrc'
  8. autoload -Uz compinit
  9. compinit
  10. # Load RVM into a shell session *as a function*
  11. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
  12. autoload -U colors && colors
  13. # Have to reset color to cyan after the bold tags for some reason.
  14. PROMPT="%{$fg[cyan]%}[%n@%M %B%1~%b%{$fg[cyan]%}]%# %{$reset_color%}"
  15. alias ll='ls -alF'
  16. alias la='ls -A'
  17. alias l='ls -CF'
  18. alias ls='ls -G'
  19. export EDITOR="mvim"
  20. alias vim="mvim"
  21. alias vimdiff="mvimdiff"
  22. # OS X completions
  23. fpath=(/usr/local/share/zsh-completions $fpath)
  24. source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  25. # OS X keep current PWD when opening new tabs/windows
  26. precmd () {print -Pn "\e]2; %~/ \a"}
  27. preexec () {print -Pn "\e]2; %~/ \a"}
  28. dot_sync() {
  29. current_branch=$(git branch | grep '\*.*' | cut -d '*' -f 2 | tr -d ' ')
  30. if [ -z "$1" ]; then
  31. 1=$current_branch
  32. fi
  33. for branch in $(git branch | grep '^[^*].*$'); do
  34. git ch $branch
  35. git cherry-pick $1 || { echo 'Problems.. manually cherry-pick'; return 0 }
  36. done
  37. git ch $current_branch
  38. }
  39. # Set Home, End, Del, PgUp, PgDown keys to actually do something.
  40. bindkey '^[OH' beginning-of-line
  41. bindkey '^[OF' end-of-line
  42. bindkey '^[[3~' delete-char
  43. bindkey '^[[5~' beginning-of-buffer-or-history
  44. bindkey '^[[6~' end-of-buffer-or-history
  45. export DOTFILES=$HOME/Documents/dotfiles
  46. export PATH=$DOTFILES/bin:$PATH
  47. export PATH=$PATH:$HOME/.rvm/bin
  48. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"