Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.59 KB | None | 0 0
  1. # The following lines were added by compinstall
  2.  
  3. zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )'
  4. zstyle ':completion:*:complete:-command-::commands' ignored-patterns '(aptitude-*|*\~)'
  5. zstyle ':completion:*:correct:*' insert-unambiguous true
  6. zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}'
  7. zstyle ':completion:*:correct:*' original true
  8. zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
  9. zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}'
  10. zstyle ':completion:*:expand:*' tag-order all-expansions
  11. zstyle ':completion:*:history-words' list false
  12. zstyle ':completion:*:history-words' menu yes
  13. zstyle ':completion:*:history-words' remove-all-dups yes
  14. zstyle ':completion:*:history-words' stop yes
  15. zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
  16. zstyle ':completion:*:matches' group 'yes'
  17. zstyle ':completion:*' group-name ''
  18. zstyle ':completion:*' menu select=5
  19. zstyle ':completion:*:messages' format '%d'
  20. zstyle ':completion:*:options' auto-description '%d'
  21. zstyle ':completion:*:options' description 'yes'
  22. zstyle ':completion:*:processes' command 'ps -au$USER'
  23. zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
  24. zstyle ':completion:*' verbose true
  25. zstyle ':completion:*:-command-:*:' verbose false
  26. zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for:%{\e[0m%} %d'
  27. zstyle ':completion:*:*:zcompile:*' ignored-patterns '(*~|*.zwc)'
  28. zstyle ':completion:correct:' prompt 'correct to: %e'
  29. zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*'
  30. zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
  31. zstyle ':completion:*:manuals' separate-sections true
  32. zstyle ':completion:*:manuals.*' insert-sections true
  33. zstyle ':completion:*:man:*' menu yes select
  34. zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
  35. /usr/local/bin \
  36. /usr/sbin \
  37. /usr/bin \
  38. /sbin \
  39. /bin \
  40. zstyle ':completion:*' special-dirs ..
  41. function _force_rehash () {
  42. (( CURRENT == 1 )) && rehash
  43. return 1
  44. }
  45. zstyle -e ':completion:*' completer '
  46. if [[ $_last_try != "$HISTNO$BUFFER$CURSOR" ]] ; then
  47. _last_try="$HISTNO$BUFFER$CURSOR"
  48. reply=(_complete _match _ignored _prefix _files)
  49. else
  50. if [[ $words[1] == (rm|mv) ]] ; then
  51. reply=(_complete _files)
  52. else
  53. reply=(_oldlist _expand _force_rehash _complete _ignored _correct _approximate _files)
  54. fi
  55. fi'
  56. zstyle ':completion:*:urls' local 'www' '/var/www/' 'public_html'
  57. zstyle ':completion::complete:*' gain-privileges 1
  58. zstyle :compinstall filename '/home/pk/.zshrc'
  59.  
  60. autoload -Uz compinit
  61. compinit
  62. # End of lines added by compinstall
  63. # Lines configured by zsh-newuser-install
  64. HISTORY_IGNORE="(exit|clear|reset)"
  65. HISTFILE=~/.zsh_history
  66. HISTSIZE=500
  67. SAVEHIST=5000
  68. setopt appendhistory
  69. setopt autocd
  70. setopt beep
  71. setopt extendedglob
  72. setopt nomatch
  73. setopt notify
  74. setopt complete_aliases
  75. setopt always_to_end
  76. setopt complete_in_word
  77. setopt nomatch
  78. setopt hist_ignore_all_dups
  79. setopt hist_ignore_space
  80. setopt hist_save_no_dups
  81. setopt share_history
  82. setopt list_packed
  83. setopt correct
  84. setopt prompt_subst
  85. bindkey -e
  86. # End of lines configured by zsh-newuser-install
  87.  
  88. # load a few modules
  89. if [[ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]]; then
  90. . /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  91. fi
  92. autoload -U zmv
  93. autoload -U zed
  94. autoload -U zargs
  95. autoload -U colors && colors
  96.  
  97. # set default programmes
  98. export EDITOR=${EDITOR:-ex}
  99. export VISUAL=${VISUAL:-vimx}
  100. export PAGER=${PAGER:-less}
  101. export SYSTEMD_LESS="RM"
  102.  
  103. # set alias'
  104. alias vim="vimx"
  105. alias ls="ls -v --color=auto -N --group-directories-first"
  106.  
  107. # report about cpu-/system-/user-time of command if running longer than
  108. # 5 seconds
  109. REPORTTIME=5
  110.  
  111. # support colors in less
  112. export LESS_TERMCAP_mb=$'\E[01;31m'
  113. export LESS_TERMCAP_md=$'\E[01;31m'
  114. export LESS_TERMCAP_me=$'\E[0m'
  115. export LESS_TERMCAP_se=$'\E[0m'
  116. export LESS_TERMCAP_so=$'\E[01;44;33m'
  117. export LESS_TERMCAP_ue=$'\E[0m'
  118. export LESS_TERMCAP_us=$'\E[01;32m'
  119.  
  120. # Modify the colors and symbols in these variables as desired.
  121. GIT_PROMPT_SYMBOL="%{$fg[blue]%}±"
  122. GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$reset_color%}"
  123. GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}"
  124. GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}"
  125. GIT_PROMPT_BEHIND="%{$fg[cyan]%}BNUM%{$reset_color%}"
  126. GIT_PROMPT_MERGING="%{$fg[magenta]%}⚡︎%{$reset_color%}"
  127. GIT_PROMPT_UNTRACKED="%{$fg[red]%}●%{$reset_color%}"
  128. GIT_PROMPT_MODIFIED="%{$fg[yellow]%}●%{$reset_color%}"
  129. GIT_PROMPT_STAGED="%{$fg[green]%}●%{$reset_color%}"
  130.  
  131. # Show Git branch/tag, or name-rev if on detached head
  132. parse_git_branch() {
  133. (git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD) 2> /dev/null
  134. }
  135.  
  136. # Show different symbols as appropriate for various Git repository states
  137. parse_git_state() {
  138.  
  139. # Compose this value via multiple conditional appends.
  140. local GIT_STATE=""
  141.  
  142. local NUM_AHEAD="$(git log --oneline @{u}.. 2> /dev/null | wc -l | tr -d ' ')"
  143. if [ "$NUM_AHEAD" -gt 0 ]; then
  144. GIT_STATE=$GIT_STATE${GIT_PROMPT_AHEAD//NUM/$NUM_AHEAD}
  145. fi
  146.  
  147. local NUM_BEHIND="$(git log --oneline ..@{u} 2> /dev/null | wc -l | tr -d ' ')"
  148. if [ "$NUM_BEHIND" -gt 0 ]; then
  149. GIT_STATE=$GIT_STATE${GIT_PROMPT_BEHIND//NUM/$NUM_BEHIND}
  150. fi
  151.  
  152. local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)"
  153. if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then
  154. GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING
  155. fi
  156.  
  157. if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
  158. GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED
  159. fi
  160.  
  161. if ! git diff --quiet 2> /dev/null; then
  162. GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED
  163. fi
  164.  
  165. if ! git diff --cached --quiet 2> /dev/null; then
  166. GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED
  167. fi
  168.  
  169. if [[ -n $GIT_STATE ]]; then
  170. echo "$GIT_PROMPT_PREFIX$GIT_STATE$GIT_PROMPT_SUFFIX"
  171. fi
  172.  
  173. }
  174.  
  175. # If inside a Git repository, print its branch and state
  176. git_prompt_string() {
  177. local git_where="$(parse_git_branch)"
  178. [ -n "$git_where" ] && echo "$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX"
  179. }
  180.  
  181. # prompts
  182. PS1='%(#.[%F{red}%B%n%b%f@%m %1~].[%F{blue}%B%n%b%f@%m %1~])$(git_prompt_string)%(#.#.$) '
  183. PS2="> "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement