zshrc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. eval "$(dircolors -b ~/.dircolors)"
  2. autoload -Uz compinit
  3. compinit
  4. zmodload -a complist
  5. zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  6. zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
  7. zstyle ':completion:*' use-compctl false
  8. zstyle :compinstall filename '/home/raylu/.zshrc'
  9. HISTFILE=~/.histfile
  10. HISTSIZE=1000
  11. SAVEHIST=5000
  12. setopt no_beep
  13. setopt extendedglob
  14. #setopt print_exit_value
  15. setopt prompt_subst
  16. setopt complete_in_word
  17. setopt no_auto_menu
  18. setopt no_always_last_prompt
  19. setopt share_history
  20. setopt hist_ignore_dups
  21. setopt hist_ignore_space
  22. setopt extended_history
  23. setopt promptsubst
  24. autoload -U edit-command-line
  25. zle -N edit-command-line
  26. bindkey -e
  27. bindkey '^[[3~' delete-char
  28. bindkey '\C-v' edit-command-line
  29. bindkey '^[[1;5C' forward-word
  30. bindkey '^[[1;5D' backward-word
  31. local WORDCHARS=${WORDCHARS//\//}
  32. autoload colors
  33. colors
  34. bright_cyan='%{%}' # not provided by colors
  35. PROMPT="%{${fg_bold[green]}%}%m%{${reset_color}%}:%{${fg_bold[blue]}%}%30<...<%~%<<%{${reset_color}%}%(!.#.\$) "
  36. # exit status
  37. RPROMPT="%(?..%{$fg_bold[red]%}%? %{$reset_color%})"
  38. # suspended jobs
  39. RPROMPT+="%1(j.%{$fg[green]%}%j .)"
  40. # git branch
  41. autoload -Uz vcs_info
  42. zstyle ':vcs_info:*' unstagedstr "%{$fg[red]%}*"
  43. zstyle ':vcs_info:*' stagedstr "%{$fg[red]%}+"
  44. zstyle ':vcs_info:*' formats "$bright_cyan%b%u%c"
  45. zstyle ':vcs_info:*' actionformats "$bright_cyan%b%u%c|%a"
  46. zstyle ':vcs_info:git:*' check-for-changes true
  47. zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b:%r'
  48. zstyle ':vcs_info:bzr:*' use-simple true
  49. zstyle ':vcs_info:*' enable git hg bzr svn cvs
  50. precmd () { vcs_info }
  51. RPROMPT+='${vcs_info_msg_0_}'
  52. RPROMPT+="%{$reset_color%}"
  53. export EDITOR=vim
  54. export MANPAGER="/bin/sh -c \"col -bx | vim -c 'set ft=man' -\""
  55. export GREP_COLORS='ms=01;36:mc=01;31:sl=:cx=:fn=35:ln=33:bn=33:se=01;34'
  56. alias ls='ls --color=auto -hv'
  57. alias ll='ls -l'
  58. alias l.='ls -Ad .*'
  59. alias la='ls -A'
  60. alias grep='grep --color -nTs'
  61. alias df='df -hx tmpfs'
  62. alias du='du --max-depth=1'
  63. alias sr='screen -r'
  64. alias mp='~/mplayer/mplayer/mplayer'
  65. alias manmp='man -l ~/mplayer/mplayer/DOCS/man/en/mplayer.1'
  66. alias mencoder='~/mplayer/mplayer/mencoder'
  67. alias x264='~/x264/x264'
  68. alias gil='git log --graph --abbrev-commit --stat --decorate --patience'
  69. alias gib='git branch -a'
  70. alias gis='git status'
  71. alias gid='git diff --patience'
  72. alias giw='git show --patience'
  73. alias gic='git checkout'
  74. alias class='xprop -notype WM_CLASS'
  75. alias tree='tree -AvL 10'
  76. alias vil='vi *(.om[1])'
  77. alias dt='gnome-terminal --hide-menubar'
  78. alias archvm='kvm -hda arch.qcow -net nic -net user,hostfwd=tcp::8080-:80,hostfwd=tcp::2222-:22'
  79. function cl() {
  80. if [ $# = 0 ]; then
  81. cd && ls
  82. else
  83. cd "$*" && ls
  84. fi
  85. }
  86. function pdf() {
  87. evince "$*" &> /dev/null &!
  88. }
  89. export GOROOT=$HOME/go
  90. PATH=$PATH:$HOME/go/bin:/sbin:/usr/sbin