zshrc 3.1 KB

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