Advertisement
martadinata

zshrc+urxvt

May 12th, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.27 KB | None | 0 0
  1. #zshrc
  2. # Lines configured by zsh-newuser-install
  3. HISTFILE=~/.histfile
  4. HISTSIZE=1000
  5. SAVEHIST=1000
  6. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  7. setopt appendhistory autocd nomatch notify
  8. unsetopt beep extendedglob
  9.  
  10. bindkey '^?' backward-delete-char
  11. bindkey '^[[7~' beginning-of-line
  12. bindkey '^[[1~' beginning-of-line
  13. bindkey '^[[5~' up-line-or-history
  14. bindkey '^[[3~' delete-char
  15. bindkey '^[[8~' end-of-line
  16. bindkey '^[[4~' end-of-line
  17. bindkey '^[[6~' down-line-or-history
  18. bindkey '^[[A' up-line-or-search
  19. bindkey '^[[D' backward-char
  20. bindkey '^[[B' down-line-or-search
  21. bindkey '^[[C' forward-char
  22. bindkey '^[[2~' overwrite-mode
  23.  
  24. case $TERM in
  25. xterm*|rxvt*|screen*)
  26. precmd() { print -Pn "\e]0;%m : %~\a" }
  27. preexec () { print -Pn "\e]0;$1\a" }
  28. ;;
  29. esac
  30.  
  31. PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib/ccache/bin/:/usr/lib/colorgcc/bin:/opt/android-sdk/platform-tools:/opt/java/bin:/opt/java/db/bin:/opt/java/jre/bin"
  32. export PATH
  33. export SAL_USE_VCLPLUGIN=gtk
  34. autoload -Uz compinit
  35. compinit
  36. autoload -U promptinit
  37. promptinit
  38. autoload -U colors && colors
  39.  
  40. PROMPT="%{$fg[yellow]%}%B%n%b %B%{$fg[white]%}%#%b %{$fg[yellow]%}%B%U%~%u%b%{$fg[red]%}%B > %b"
  41. #PROMPT="%{$fg[black]%}%B%n%b %B%{$fg[black]%}%#%b %{$fg[black]%}%B%U%~%u%b%{$fg[black]%}%B > %b"
  42. #------------------------------------------////
  43. # Proxy:
  44. #------------------------------------------////
  45. #http_proxy=http://127.0.0.1:8118/
  46. #HTTP_PROXY=$http_proxy
  47. #export http_proxy HTTP_PROXY
  48.  
  49. #------------------------------------------////
  50. # Aliases:
  51. #------------------------------------------////
  52. ## make ls list by size
  53. ##alias ls='du -s */* | sort -n'
  54. alias findbig='find . -type f -exec ls -s {} \; | sort -n -r | head -5'
  55. alias ls='ls -aF --color=always'
  56. alias la='ls -Al'
  57. alias lx='ls -lXB'
  58. alias lk='ls -lSr'
  59. alias lc='ls -lcr'
  60. alias lu='ls -lur'
  61. alias lr='ls -lR'
  62. alias lt='ls -ltr'
  63. alias lm='ls -al |more'
  64. alias sch='cat /sys/block/sda/queue/scheduler'
  65. #alias rm='rm -i'
  66. alias startservice='sudo systemctl start'
  67. alias stopservice='sudo systemctl stop'
  68. alias restartservice='sudo systemctl restart'
  69. alias reloadservice='sudo systemctl --daemon-reload'
  70. alias enableservice='sudo systemctl enable'
  71. alias disableservice='sudo systemctl disable'
  72. alias installpkg='sudo yaourt -S'
  73. alias removepkg='sudo yaourt -Rscnd'
  74. alias syncpkg='sudo yaourt -Sy'
  75. alias uppkg='sudo yaourt -Su'
  76. #------------------------------------------////
  77. # Functions and Scripts:
  78. #------------------------------------------////
  79. localnet ()
  80. {
  81. /sbin/ifconfig | awk /'inet addr/ {print $2}'
  82. echo ""
  83. /sbin/ifconfig | awk /'Bcast/ {print $3}'
  84. echo ""
  85. }
  86.  
  87. upinfo ()
  88. {
  89. echo -ne "$fg[white]uptime is $fg[yellow] \t\t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
  90. }
  91. cd()
  92. {
  93. if [ -n "$1" ]; then
  94. builtin cd "$@" && ls
  95. else
  96. builtin cd ~ && ls
  97. fi
  98. }
  99.  
  100. extract()
  101. {
  102. if [ -f "$1" ] ; then
  103. case "$1" in
  104. *.tar.bz2) tar xjf "$1" ;;
  105. *.tar.gz) tar xzf "$1" ;;
  106. *.tar.Z) tar xzf "$1" ;;
  107. *.bz2) bunzip2 "$1" ;;
  108. *.rar) unrar x "$1" ;;
  109. *.gz) gunzip "$1" ;;
  110. *.jar) unzip "$1" ;;
  111. *.tar) tar xf "$1" ;;
  112. *.tbz2) tar xjf "$1" ;;
  113. *.tgz) tar xzf "$1" ;;
  114. *.zip) unzip "$1" ;;
  115. *.Z) uncompress "$1" ;;
  116. *) echo "'$1' cannot be extracted." ;;
  117. esac
  118. else
  119. echo "'$1' is not a file."
  120. fi
  121. }
  122.  
  123. setopt AUTO_LIST
  124. setopt AUTO_MENU
  125. setopt MENU_COMPLETE
  126. export LC_ALL=id_ID.UTF-8
  127. export LANG=id_ID.UTF-8
  128. autoload -U compinit
  129. compinit
  130.  
  131. # Completion caching
  132. zstyle ':completion::complete:*' use-cache on
  133. zstyle ':completion::complete:*' cache-path .zcache
  134. zstyle ':completion:*:cd:*' ignore-parents parent pwd
  135.  
  136. #Completion Options
  137. zstyle ':completion:*:match:*' original only
  138. zstyle ':completion::prefix-1:*' completer _complete
  139. zstyle ':completion:predict:*' completer _complete
  140. zstyle ':completion:incremental:*' completer _complete _correct
  141. zstyle ':completion:*' completer _complete _prefix _correct _prefix _match _approximate
  142.  
  143. # Path Expansion
  144. zstyle ':completion:*' expand 'yes'
  145. zstyle ':completion:*' squeeze-shlashes 'yes'
  146. zstyle ':completion::complete:*' '\\'
  147.  
  148. zstyle ':completion:*:*:*:default' menu yes select
  149. zstyle ':completion:*:*:default' force-list always
  150.  
  151. # GNU Colors 需要/etc/DIR_COLORS文件 否则自动补全时候选菜单中的选项不能彩色显示
  152. [ -f /etc/DIR_COLORS ] && eval $(dircolors -b /etc/DIR_COLORS)
  153. export ZLSCOLORS="${LS_COLORS}"
  154. zmodload zsh/complist
  155. zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
  156. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
  157.  
  158. zstyle ':completion:*' completer _complete _match _approximate
  159. zstyle ':completion:*:match:*' original only
  160. zstyle ':completion:*:approximate:*' max-errors 1 numeric
  161.  
  162. compdef pkill=kill
  163. compdef pkill=killall
  164. zstyle ':completion:*:*:kill:*' menu yes select
  165. zstyle ':completion:*:processes' command 'ps -au$USER'
  166.  
  167. # Group matches and Describe
  168. zstyle ':completion:*:matches' group 'yes'
  169. zstyle ':completion:*:options' description 'yes'
  170. zstyle ':completion:*:options' auto-description '%d'
  171. zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m'
  172. zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m'
  173. zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m'
  174.  
  175.  
  176. #print -Pc '%B`figlet "ArchLinux"%b`'
  177. #echo -e "$bold_color $fg[yellow]";figlet "ArchLinux";
  178. #echo -n "$fg[white]Today is:\t\t$fg[yellow]" `date`; echo ""
  179. #echo -e "$fg[white]Kernel Information: \t$fg[yellow]" `uname -smr`
  180. #echo -ne "$fg[white]";upinfo;echo " "
  181. #echo -e "$fg[white]"; cal -3
  182. # End of lines added by compinstall
  183.  
  184. #~/.Xresources
  185. ! General
  186. urxvt*termName: rxvt-unicode-256color
  187. urxvt*loginShell: true
  188. urxvt*scrollBar: false
  189. urxvt*secondaryScroll: true
  190. urxvt*saveLines: 65535
  191. urxvt*cursorBlink: false
  192. urxvt*urgentOnBell: true
  193. !urxvt*override-redirect:false
  194. !urxvt*borderLess: false
  195. !urxvt*internalBorder: 0
  196. !urxvt*externalBorder: 0
  197. urxvt*perl-lib: /usr/lib/urxvt/perl/
  198. urxvt*perl-ext-common: default,matcher,searchable-scrollback
  199. urxvt*urlLauncher: /usr/bin/firefox
  200. urxvt*matcher.button: 1
  201. urxvt*depth: 32
  202.  
  203. ! Appearance
  204. ! - use a bitmap font
  205. !urxvt*font: -xos4-terminus-medium-*-*-*-12-*-*-*-*-*-*-*
  206. !urxvt*boldFont: -xos4-terminus-bold-*-*-*-12-*-*-*-*-*-*-*
  207. ! - use xft for drawing fonts
  208. urxvt*font: xft:Terminus:10
  209. ! - cursor
  210. urxvt*cursorColor: #DCDCCC
  211. ! - pseudo transparency
  212. !urxvt*shading: 15
  213. !urxvt*transparent:true
  214. !
  215. ! - color scheme
  216. urxvt.background: [80]#000000
  217. urxvt.foreground: #EBEBFF
  218. ! black + red
  219. !urxvt*color0: #3f3f3f
  220. urxvt*color0: #000000
  221. urxvt*color1: #e01010
  222. ! green + yellow
  223. urxvt*color2: #00AA00
  224. urxvt*color3: #FFFF00
  225. ! blue + purple
  226. urxvt*color4: #112037
  227. urxvt*color5: #A020F0
  228. ! cyan + white
  229. urxvt*color6: #5B5BC7
  230. urxvt*color7: #fefefe
  231. ! bright-black + bright-red
  232. urxvt*color8: #6a6a6a
  233. urxvt*color9: #FF5555
  234. ! bright-green + bright-yellow
  235. urxvt*color10: #90EE90
  236. urxvt*color11: #ffff2f
  237. ! bright-blue + bright-purple
  238. urxvt*color12: #5B5BC7
  239. urxvt*color13: #e628ba
  240. ! bright-cyan + bright-white
  241. urxvt*color14: #7D7DFB
  242. urxvt*color15: #ffffff
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement