zshrc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 ':completion:*' use-cache on
  9. zstyle ':completion:*' cache-path ~/.zshcache
  10. __git_files () {
  11. _wanted files expl 'local files' _files
  12. }
  13. zstyle :compinstall filename '/home/raylu/.zshrc'
  14. HISTFILE=~/.histfile
  15. HISTSIZE=10000
  16. SAVEHIST=10000
  17. setopt no_beep
  18. setopt extendedglob
  19. #setopt print_exit_value
  20. setopt prompt_subst
  21. setopt complete_in_word
  22. setopt no_auto_menu
  23. setopt no_always_last_prompt
  24. setopt share_history
  25. setopt hist_ignore_dups
  26. setopt hist_ignore_space
  27. setopt extended_history
  28. setopt promptsubst
  29. setopt autopushd
  30. setopt pushdignoredups
  31. autoload -U edit-command-line
  32. zle -N edit-command-line
  33. bindkey -e
  34. bindkey '^[[3~' delete-char
  35. bindkey '^[[1;5C' forward-word
  36. bindkey '^[[1;5D' backward-word
  37. bindkey '\C-v' edit-command-line
  38. bindkey '\Ea' push-line
  39. local WORDCHARS=${WORDCHARS//\//}
  40. autoload colors
  41. colors
  42. bright_cyan='%{%}' # not provided by colors
  43. PROMPT="%{${fg_bold[green]}%}%m%{${reset_color}%}:%{${fg_bold[blue]}%}%30<...<%~%<<%{${reset_color}%}%(!.#.\$) "
  44. RPROMPT="%(?..%{$fg_bold[red]%}%? %{$reset_color%})" # exit status
  45. RPROMPT+="%1(j.%{$fg[green]%}%j .)" # suspended jobs
  46. autoload -Uz vcs_info
  47. zstyle ':vcs_info:*' unstagedstr "%{$fg[red]%}*"
  48. zstyle ':vcs_info:*' stagedstr "%{$fg[red]%}+"
  49. zstyle ':vcs_info:*' formats "$bright_cyan%b%u%c"
  50. zstyle ':vcs_info:*' actionformats "$bright_cyan%b%u%c|%a"
  51. zstyle ':vcs_info:git:*' check-for-changes true
  52. zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b:%r'
  53. zstyle ':vcs_info:bzr:*' use-simple true
  54. zstyle ':vcs_info:*' enable git hg bzr svn cvs
  55. precmd () { vcs_info }
  56. RPROMPT+='${vcs_info_msg_0_}'
  57. RPROMPT+="%{$reset_color%}"
  58. autoload -U url-quote-magic
  59. zle -N self-insert url-quote-magic
  60. export EDITOR=vim
  61. export MANPAGER="/bin/sh -c \"col -bx | vim -c 'set ft=man' -\""
  62. export GREP_COLORS='ms=01;36:mc=01;31:sl=:cx=:fn=35:ln=33:bn=33:se=01;34'
  63. alias ls='ls --color=auto -hv --group-directories-first'
  64. alias ll='ls -l'
  65. alias l.='ls -Ad .*'
  66. alias la='ls -A'
  67. alias grep='grep --color -nTs'
  68. alias df='df -hx tmpfs'
  69. alias du='du --max-depth=1'
  70. alias sr='screen -r'
  71. alias mp='~/mplayer/mplayer/mplayer'
  72. alias manmp='man -l ~/mplayer/mplayer/DOCS/man/en/mplayer.1'
  73. alias mencoder='~/mplayer/mplayer/mencoder'
  74. alias x264='~/x264/x264'
  75. alias gil='git log --graph --abbrev-commit --stat -C --decorate --date=local'
  76. alias gib='git branch -a'
  77. alias gis='git status'
  78. alias gid='git diff -C --date=local'
  79. alias giw='git show -C --date=local --decorate'
  80. alias gic='git checkout'
  81. alias gibl='gil master..HEAD'
  82. alias class='xprop -notype WM_CLASS'
  83. alias tree='tree -AvL 10'
  84. alias vil='vi *(.om[1])'
  85. alias dt='gnome-terminal --hide-menubar'
  86. alias sudovi='sudo vi -N -u /home/raylu/.vimrc'
  87. function cl() {
  88. if [ $# = 0 ]; then
  89. cd && ls
  90. else
  91. cd "$*" && ls
  92. fi
  93. }
  94. function pdf() {
  95. evince "$*" &> /dev/null &!
  96. }
  97. export GOROOT=$HOME/go
  98. export PYTHONSTARTUP=$HOME/.pystartup.py
  99. PATH=$PATH:$HOME/go/bin:/sbin:/usr/sbin
  100. if [ -d $HOME/bin ]; then
  101. PATH=$HOME/bin:$PATH
  102. fi
  103. stty stop undef