zshrc 1.5 KB

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