zshrc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. autoload colors
  32. colors
  33. bright_cyan='%{%}' # not provided by colors
  34. PROMPT="%{${fg_bold[green]}%}%m%{${reset_color}%}:%{${fg_bold[blue]}%}%30<...<%~%<<%{${reset_color}%}%(!.#.\$) "
  35. # exit status
  36. RPROMPT="%(?..%{$fg_bold[red]%}%? %{$reset_color%})"
  37. # suspended jobs
  38. RPROMPT+="%1(j.%{$fg[green]%}%j .)"
  39. # git branch
  40. autoload -Uz vcs_info
  41. zstyle ':vcs_info:*' unstagedstr "%{$fg[red]%}*"
  42. zstyle ':vcs_info:*' stagedstr "%{$fg[red]%}+"
  43. zstyle ':vcs_info:*' formats "$bright_cyan%b%u%c"
  44. zstyle ':vcs_info:*' actionformats "$bright_cyan%b%u%c|%a"
  45. zstyle ':vcs_info:git:*' check-for-changes true
  46. zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b:%r'
  47. zstyle ':vcs_info:bzr:*' use-simple true
  48. zstyle ':vcs_info:*' enable git hg bzr svn cvs
  49. precmd () { vcs_info }
  50. RPROMPT+='${vcs_info_msg_0_}'
  51. RPROMPT+="%{$reset_color%}"
  52. export EDITOR=vim
  53. export MANPAGER="/bin/sh -c \"col -bx | vim -R -c 'set ft=man nomod nolist' -c 'map q :q<CR>' -\""
  54. export GREP_COLORS='ms=01;36:mc=01;31:sl=:cx=:fn=35:ln=33:bn=33:se=01;34'
  55. alias ls='ls --color=auto -hv'
  56. alias ll='ls -l'
  57. alias l.='ls -Ad .*'
  58. alias la='ls -A'
  59. alias grep='grep --color -nTs'
  60. alias df='df -hx tmpfs'
  61. alias du='du --max-depth=1'
  62. alias mp='~/mplayer/mplayer/mplayer'
  63. alias manmp='man -l ~/mplayer/mplayer/DOCS/man/en/mplayer.1'
  64. alias mencoder='~/mplayer/mplayer/mencoder'
  65. alias x264='~/x264/x264'
  66. alias gil='git log --graph --abbrev-commit --stat --decorate --patience'
  67. alias gib='git branch -a'
  68. alias gis='git status'
  69. alias gid='git diff --patience'
  70. alias giw='git show --patience'
  71. alias gic='git checkout'
  72. alias class='xprop -notype WM_CLASS'
  73. alias tree='tree -AvL 10'
  74. alias vil='vi *(.om[1])'
  75. alias dt='gnome-terminal --hide-menubar'
  76. alias archvm='kvm -hda arch.qcow -net nic -net user,hostfwd=tcp::8080-:80,hostfwd=tcp::2222-:22'
  77. function cl() {
  78. if [ $# = 0 ]; then
  79. cd && ls
  80. else
  81. cd "$*" && ls
  82. fi
  83. }
  84. function pdf() {
  85. evince "$*" &> /dev/null &!
  86. }
  87. export GOROOT=$HOME/go
  88. PATH=/usr/lib/ccache:$PATH:/home/raylu/go/bin:/sbin:/usr/sbin
  89. export XLISPPATH=~/nyquist/runtime:~/nyquist/lib