Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Paste Description for .zshrc

Ravil's zsh config file

.zshrc
Thursday, September 17th, 2009 at 12:41:48pm MDT 

  1. HISTFILE=~/.histfile
  2. HISTSIZE=1000
  3. SAVEHIST=1000
  4. setopt appendhistory extendedglob
  5. setopt prompt_subst
  6. #bindkey -v
  7. zstyle :compinstall filename '/home/ravil/.zshrc'
  8.  
  9. autoload -Uz compinit
  10. compinit
  11.  
  12. autoload colors
  13. colors
  14.  
  15. autoload -Uz vcs_info
  16.  
  17. # set some colors
  18. for COLOR in RED GREEN YELLOW WHITE BLACK CYAN; do
  19.     eval PR_$COLOR='%{$fg[${(L)COLOR}]%}'
  20.     eval PR_BRIGHT_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
  21. done
  22. PR_RESET="%{${reset_color}%}";
  23.  
  24. # set formats
  25. # %b - branchname
  26. # %u - unstagedstr (see below)
  27. # %c - stangedstr (see below)
  28. # %a - action (e.g. rebase-i)
  29. # %R - repository path
  30. # %S - path in the repository
  31. FMT_BRANCH="${PR_GREEN}%b%u:%c${PR_RESET}" # e.g. master¹²
  32. FMT_ACTION="(${PR_CYAN}%a${PR_RESET}%)"   # e.g. (rebase-i)
  33. FMT_PATH="%R${PR_YELLOW}/%S"              # e.g. ~/repo/subdir
  34.  
  35. function precmd {
  36.     vcs_info 'prompt'
  37. }
  38.  
  39. function rprompt {
  40.     local brackets=$1
  41.     local color1=$2 
  42.     local color2=$3 
  43.  
  44.     local bracket_open="${color1}${brackets[1]}${PR_RESET}"
  45.     local bracket_close="${color1}${brackets[2]}"         
  46.  
  47.     local git='$vcs_info_msg_0_'                           
  48.     local cwd="${color2}%B%1~%b"
  49.  
  50.     RPROMPT="${PR_RESET}${bracket_open}${git}${cwd}${bracket_close}%# ${PR_RESET}"
  51. }
  52.  
  53. function lprompt {
  54.     local brackets=$1
  55.     local color1=$2
  56.     local color2=$3
  57.  
  58.     local bracket_open="${color1}${brackets[1]}${PR_RESET}"
  59.     local bracket_close="${color1}${brackets[2]}${PR_RESET}"
  60.     local colon="${color1}:"
  61.     local at="${PR_BRIGHT_GREEN}@${PR_RESET}"
  62.  
  63.     local user_host="${PR_YELLOW}%n${at}${PR_YELLOW}%m"
  64.     local vcs_cwd='${${vcs_info_msg_1_%%.}/$HOME/~}'
  65.     local cwd="${color2}%B%20<..<${vcs_cwd}%<<%b"
  66.     local inner="${user_host}${colon}${cwd}"
  67.  
  68.     PROMPT="${PR_RESET}${bracket_open}${inner}${bracket_close}${PR_RESET}$ "
  69. }
  70.  
  71. lprompt '[]' $BR_BRIGHT_BLACK $PR_WHITE
  72. rprompt '()' $BR_BRIGHT_BLACK $PR_WHITE
  73.  
  74.  
  75. # check-for-changes can be really slow.
  76. # you should disable it, if you work with large repositories   
  77. zstyle ':vcs_info:*:prompt:*' check-for-changes true
  78. zstyle ':vcs_info:*:prompt:*' unstagedstr '¹'  # display ¹ if there are unstaged changes
  79. zstyle ':vcs_info:*:prompt:*' stagedstr '²'    # display ² if there are staged changes
  80. zstyle ':vcs_info:*:prompt:*' actionformats "${FMT_BRANCH}${FMT_ACTION}//" "${FMT_PATH}"
  81. zstyle ':vcs_info:*:prompt:*' formats       "${FMT_BRANCH}//"              "${FMT_PATH}"
  82. zstyle ':vcs_info:*:prompt:*' nvcsformats   ""                             "%~"         
  83.  
  84.  
  85. # подсветка выбранного пункта из автодополнялки и разноцветное меню
  86. zmodload zsh/complist
  87. zstyle ':completion:*' menu yes select
  88. zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
  89.  
  90. # бодрое автодополнение для kill и killall
  91. zstyle ':completion:*:processes' command 'ps -xuf'
  92. zstyle ':completion:*:processes' sort false
  93. zstyle ':completion:*:processes-names' command 'ps xho command'
  94.  
  95. #PROMPT="%n@%m %~ %(!.#.$) "
  96.  
  97. alias ls="ls --color"
  98.  
  99. # tetris! %)
  100. autoload -U tetris
  101. zle -N tetris
  102. bindkey "^T" tetris
  103.  
  104. autoload -U zcalc
  105.  
  106. export MANPAGER="`which most` -s"
  107. export PATH="$PATH:/opt/sunstudio12.1/bin"
  108. # manpath="$MANPATH:/home/ravil/Download/SunStudio/sunstudio12.1/man"

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right