zshrc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 '/home/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 --color=auto'
  17. eval "$(hub alias -s)"
  18. # Allow ctrl+S in vim to save files, ie pass
  19. # the command to vim when vim is open.
  20. vim() {
  21. local STTYOPTS="$(stty --save)"
  22. stty stop '' -ixoff
  23. command vim --servername vim "$@"
  24. stty "$STTYOPTS"
  25. }
  26. export EDITOR="vim"
  27. dot_sync() {
  28. current_branch=$(git branch | grep '\*.*' | cut -d '*' -f 2 | tr -d ' ')
  29. if [ -z "$1" ]; then
  30. 1=$current_branch
  31. fi
  32. for branch in $(git branch | grep '^[^*].*$'); do
  33. git ch $branch
  34. git cherry-pick $1 || { echo 'Problems.. manually cherry-pick'; return 0 }
  35. done
  36. git ch $current_branch
  37. }
  38. rmorig() {
  39. if [ "$1" = "-f" ]; then
  40. find . -name "*.orig" -print -delete
  41. else
  42. find . -name "*.orig" -print
  43. fi
  44. }
  45. # Set Home, End, Del, PgUp, PgDown keys to actually do something.
  46. bindkey '^[OH' beginning-of-line
  47. bindkey '^[OF' end-of-line
  48. bindkey '^[[3~' delete-char
  49. bindkey '^[[5~' beginning-of-buffer-or-history
  50. bindkey '^[[6~' end-of-buffer-or-history
  51. if [ -x /usr/bin/ssh-agent -a -z "$SSH_AUTH_SOCK" ]; then
  52. eval "$(keychain --eval -Q -q --agents ssh `find $HOME/.ssh/* ! -name '*.pub' ! -name 'config' ! -name 'known_hosts'`)"
  53. fi
  54. export PAGER=less
  55. export DOTFILES=$HOME/Documents/dotfiles
  56. export PATH=$DOTFILES/bin:$PATH
  57. export PATH=$PATH:$HOME/.rvm/bin
  58. export PATH=$PATH:/opt/android-sdk/tools:/opt/android-sdk/platform-tools
  59. [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
  60. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh