Advertisement
martadinata

zshrcnew

Mar 21st, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.48 KB | None | 0 0
  1. # Lines configured by zsh-newuser-install
  2. HISTFILE=~/.histfile
  3. HISTSIZE=1000
  4. SAVEHIST=1000
  5. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  6. setopt appendhistory autocd nomatch notify
  7. unsetopt beep extendedglob
  8. bindkey "\e[5~" beginning-of-history # PageUp
  9. bindkey "\e[6~" end-of-history # PageDown
  10. bindkey "\e[2~" quoted-insert # Ins
  11. bindkey "\e[3~" delete-char # Del
  12. bindkey "\e[5C" forward-word
  13. bindkey "\eOc" emacs-forward-word
  14. bindkey "\e[5D" backward-word
  15. bindkey "\eOd" emacs-backward-word
  16. bindkey "\e\e[C" forward-word
  17. bindkey "\e\e[D" backward-word
  18. bindkey "\e[Z" reverse-menu-complete # Shift+Tab
  19. bindkey "\eOH" beginning-of-line
  20. bindkey "\eOF" end-of-line
  21.  
  22. #HOSTNAME = Archlinux666
  23. # End of lines configured by zsh-newuser-install
  24. # The following lines were added by compinstall
  25. zstyle :compinstall filename '/home/dedy/.zshrc'
  26.  
  27.  
  28.  
  29. PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib/ccache/bin/:/usr/lib/colorgcc/bin"
  30. export PATh
  31. autoload -Uz compinit
  32. compinit
  33. autoload -U promptinit
  34. promptinit
  35. autoload -U colors && colors
  36.  
  37. PROMPT="%{$fg[yellow]%}%B%n%b %B%{$fg[white]%}%#%b %{$fg[yellow]%}%B%U%~%u%b%{$fg[red]%}%B > %b"
  38. #PROMPT="%{$fg[black]%}%B%n%b %B%{$fg[black]%}%#%b %{$fg[black]%}%B%U%~%u%b%{$fg[black]%}%B > %b"
  39. #------------------------------------------////
  40. # Proxy:
  41. #------------------------------------------////
  42. #http_proxy=http://127.0.0.1:8118/
  43. #HTTP_PROXY=$http_proxy
  44. #export http_proxy HTTP_PROXY
  45.  
  46. #------------------------------------------////
  47. # Aliases:
  48. #------------------------------------------////
  49. ## make ls list by size
  50. ##alias ls='du -s */* | sort -n'
  51. alias findbig='find . -type f -exec ls -s {} \; | sort -n -r | head -5'
  52. alias ls='ls -aF --color=always'
  53. alias la='ls -Al'
  54. alias lx='ls -lXB'
  55. alias lk='ls -lSr'
  56. alias lc='ls -lcr'
  57. alias lu='ls -lur'
  58. alias lr='ls -lR'
  59. alias lt='ls -ltr'
  60. alias lm='ls -al |more'
  61. alias sch='cat /sys/block/sda/queue/scheduler'
  62. #alias rm='rm -i'
  63. alias startservice='sudo systemctl start'
  64. alias stopservice='sudo systemctl stop'
  65. alias restartservice='sudo systemctl restart'
  66. alias reloadservice='sudo systemctl --daemon-reload'
  67. alias installpkg='sudo yaourt -S'
  68. alias removepkg='sudo yaourt -Rscnd'
  69. alias syncpkg='sudo yaourt -Sy'
  70. alias uppkg='sudo yaourt -Su'
  71. #------------------------------------------////
  72. # Functions and Scripts:
  73. #------------------------------------------////
  74. localnet ()
  75. {
  76. /sbin/ifconfig | awk /'inet addr/ {print $2}'
  77. echo ""
  78. /sbin/ifconfig | awk /'Bcast/ {print $3}'
  79. echo ""
  80. }
  81.  
  82. upinfo ()
  83. {
  84. echo -ne "$fg[white]uptime is $fg[yellow] \t\t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
  85. }
  86. cd()
  87. {
  88. if [ -n "$1" ]; then
  89. builtin cd "$@" && ls
  90. else
  91. builtin cd ~ && ls
  92. fi
  93. }
  94.  
  95. extract()
  96. {
  97. if [ -f "$1" ] ; then
  98. case "$1" in
  99. *.tar.bz2) tar xjf "$1" ;;
  100. *.tar.gz) tar xzf "$1" ;;
  101. *.tar.Z) tar xzf "$1" ;;
  102. *.bz2) bunzip2 "$1" ;;
  103. *.rar) unrar x "$1" ;;
  104. *.gz) gunzip "$1" ;;
  105. *.jar) unzip "$1" ;;
  106. *.tar) tar xf "$1" ;;
  107. *.tbz2) tar xjf "$1" ;;
  108. *.tgz) tar xzf "$1" ;;
  109. *.zip) unzip "$1" ;;
  110. *.Z) uncompress "$1" ;;
  111. *) echo "'$1' cannot be extracted." ;;
  112. esac
  113. else
  114. echo "'$1' is not a file."
  115. fi
  116. }
  117.  
  118. setopt AUTO_LIST
  119. setopt AUTO_MENU
  120. setopt MENU_COMPLETE
  121. export LC_ALL=id_ID.UTF-8
  122. export LANG=id_ID.UTF-8
  123. autoload -U compinit
  124. compinit
  125.  
  126. # Completion caching
  127. zstyle ':completion::complete:*' use-cache on
  128. zstyle ':completion::complete:*' cache-path .zcache
  129. zstyle ':completion:*:cd:*' ignore-parents parent pwd
  130.  
  131. #Completion Options
  132. zstyle ':completion:*:match:*' original only
  133. zstyle ':completion::prefix-1:*' completer _complete
  134. zstyle ':completion:predict:*' completer _complete
  135. zstyle ':completion:incremental:*' completer _complete _correct
  136. zstyle ':completion:*' completer _complete _prefix _correct _prefix _match _approximate
  137.  
  138. # Path Expansion
  139. zstyle ':completion:*' expand 'yes'
  140. zstyle ':completion:*' squeeze-shlashes 'yes'
  141. zstyle ':completion::complete:*' '\\'
  142.  
  143. zstyle ':completion:*:*:*:default' menu yes select
  144. zstyle ':completion:*:*:default' force-list always
  145.  
  146. # GNU Colors 需要/etc/DIR_COLORS文件 否则自动补全时候选菜单中的选项不能彩色显示
  147. [ -f /etc/DIR_COLORS ] && eval $(dircolors -b /etc/DIR_COLORS)
  148. export ZLSCOLORS="${LS_COLORS}"
  149. zmodload zsh/complist
  150. zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
  151. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
  152.  
  153. zstyle ':completion:*' completer _complete _match _approximate
  154. zstyle ':completion:*:match:*' original only
  155. zstyle ':completion:*:approximate:*' max-errors 1 numeric
  156.  
  157. compdef pkill=kill
  158. compdef pkill=killall
  159. zstyle ':completion:*:*:kill:*' menu yes select
  160. zstyle ':completion:*:processes' command 'ps -au$USER'
  161.  
  162. # Group matches and Describe
  163. zstyle ':completion:*:matches' group 'yes'
  164. zstyle ':completion:*:options' description 'yes'
  165. zstyle ':completion:*:options' auto-description '%d'
  166. zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m'
  167. zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m'
  168. zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m'
  169.  
  170.  
  171. #print -Pc '%B`figlet "ArchLinux"%b`'
  172. #echo -e "$bold_color $fg[yellow]";figlet "ArchLinux";
  173. #echo -n "$fg[white]Today is:\t\t$fg[yellow]" `date`; echo ""
  174. #echo -e "$fg[white]Kernel Information: \t$fg[yellow]" `uname -smr`
  175. #echo -ne "$fg[white]";upinfo;echo " "
  176. #echo -e "$fg[white]"; cal -3
  177. # End of lines added by compinstall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement