Guest User

Untitled

a guest
Sep 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. # color
  2. autoload -Uz colors
  3. colors
  4.  
  5. # left prompt
  6. case ${UID} in
  7. 0)
  8. PROMPT="# "
  9. PROMPT2="%_# "
  10. SPROMPT="%{${fg[red]}%r%} %{$reset_color%}is correct? [n,y,a,e]: "
  11. ;;
  12. *)
  13. PROMPT="%% "
  14. PROMPT2="%_%% "
  15. SPROMPT="%{${fg[red]}%r%} %{$reset_color%}is correct? [n,y,a,e]: "
  16. ;;
  17. esac
  18.  
  19. [ -n "${REMOTEHOST}${SSH_CONNECTION}" ] &&
  20. PROMPT="%{${fg[green]}%}${HOST%%.*} %{$reset_color%}${PROMPT}"
  21.  
  22. # window title
  23. case "${TERM}" in
  24. kterm*|xterm)
  25. precmd() {
  26. echo -ne "\033]0;${USER}@${HOST%%.*}:${PWD}\007"
  27. }
  28. ;;
  29. esac
  30.  
  31. # history
  32. HISTFILE=~/.histfile
  33. HISTSIZE=10000
  34. SAVEHIST=10000
  35. setopt hist_ignore_dups # ignore duplication command history list
  36. setopt share_history # share command history data
  37.  
  38. # diretory
  39. setopt auto_cd
  40. setopt auto_pushd
  41. setopt pushd_ignore_dups
  42.  
  43. # comp
  44. autoload -Uz compinit
  45. compinit
  46. zstyle :compinstall filename '~/.zshrc'
  47.  
  48. # autocorrect
  49. setopt correct
  50.  
  51. # emacs like keybind
  52. bindkey -e
  53.  
  54. # beep
  55. setopt nolistbeep
  56. setopt beep
  57. set BEEP
  58.  
  59. # other settings
  60.  
  61. # search path
  62. PATH=/usr/local/bin:$HOME/bin:/usr/local/mysql/bin:$PATH
  63.  
  64. # aliases
  65. alias h history
  66.  
  67. # env
  68. export PERL_BADLANG=0
  69. export RSYNC_RSH=ssh
  70.  
  71. # umask
  72. umask 022
  73.  
  74. # history inc.search
  75. autoload history-search-end
  76. zle -N history-beginning-search-backward-end history-search-end
  77. zle -N history-beginning-search-forward-end history-search-end
  78. bindkey "^[[A" history-beginning-search-backward-end
  79. bindkey "^[[B" history-beginning-search-forward-end
  80.  
  81. # right prompt
  82. autoload -Uz add-zsh-hook
  83. autoload -Uz vcs_info
  84.  
  85. zstyle ':vcs_info:*' enable git svn hg bzr
  86. zstyle ':vcs_info:*' formats '[%b]'
  87. zstyle ':vcs_info:*' actionformats '[%b|%a]'
  88. zstyle ':vcs_info:(svn|bzr):*' branchformat '%b:r%r'
  89. zstyle ':vcs_info:bzr:*' use-simple true
  90.  
  91. autoload -Uz is-at-least
  92. if is-at-least 4.3.10; then
  93. zstyle ':vcs_info:git:*' check-for-changes true
  94. zstyle ':vcs_info:git:*' stagedstr "+"
  95. zstyle ':vcs_info:git:*' unstagedstr "-"
  96. zstyle ':vcs_info:git:*' formats '[%b[%c%u]]'
  97. zstyle ':vcs_info:git:*' actionformats '[%b|%a[%c%u]]'
  98. fi
  99.  
  100. function _update_vcs_info_msg() {
  101. psvar=()
  102. LANG=en_US.UTF-8 vcs_info
  103. [[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
  104. }
  105. add-zsh-hook precmd _update_vcs_info_msg
  106. RPROMPT="%1(v|%F{green}%1v%f|) [%20<..<%~]"
  107.  
  108. # personal settings
  109. [ -f ~/local.zshrc ] && source ~/local.zshrc
  110.  
  111. PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
Add Comment
Please, Sign In to add comment