Advertisement
martadinata

zshrc 12nov2013

Nov 12th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.58 KB | None | 0 0
  1. #zshrc
  2.  
  3. #zshrc
  4. # Lines configured by zsh-newuser-install
  5. HISTFILE=~/.histfile
  6. HISTSIZE=1000
  7. SAVEHIST=1000
  8. source ~/.zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  9. setopt appendhistory autocd nomatch notify
  10. unsetopt beep extendedglob
  11.  
  12. # create a zkbd compatible hash;
  13. # to add other keys to this hash, see: man 5 terminfo
  14. typeset -A key
  15.  
  16. key[Home]=${terminfo[khome]}
  17.  
  18. key[End]=${terminfo[kend]}
  19. key[Insert]=${terminfo[kich1]}
  20. key[Delete]=${terminfo[kdch1]}
  21. key[Up]=${terminfo[kcuu1]}
  22. key[Down]=${terminfo[kcud1]}
  23. key[Left]=${terminfo[kcub1]}
  24. key[Right]=${terminfo[kcuf1]}
  25. key[PageUp]=${terminfo[kpp]}
  26. key[PageDown]=${terminfo[knp]}
  27.  
  28. # setup key accordingly
  29. [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
  30. [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
  31. [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode
  32. [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
  33. [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
  34. [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
  35. [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
  36. [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
  37. [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
  38. [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
  39.  
  40. # Finally, make sure the terminal is in application mode, when zle is
  41. # active. Only then are the values from $terminfo valid.
  42. if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
  43. function zle-line-init () {
  44. printf '%s' "${terminfo[smkx]}"
  45. }
  46. function zle-line-finish () {
  47. printf '%s' "${terminfo[rmkx]}"
  48. }
  49. zle -N zle-line-init
  50. zle -N zle-line-finish
  51. fi
  52.  
  53. case $TERM in
  54. xterm*|rxvt*|screen*)
  55. precmd() { print -Pn "\e]0;%m : %~\a" }
  56. preexec () { print -Pn "\e]0;$1\a" }
  57. ;;
  58. esac
  59.  
  60. 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:/opt/kde"
  61. export PATH
  62. export SAL_USE_VCLPLUGIN=gtk
  63. autoload -Uz compinit
  64. compinit
  65. autoload -U promptinit
  66. promptinit
  67. autoload -U colors && colors
  68.  
  69. PROMPT="%{$fg[yellow]%}%B%n%b %B%{$fg[white]%}%#%b %{$fg[yellow]%}%B%~%b%{$fg[red]%}%B > %b"
  70. #PROMPT="%{$fg[black]%}%B%n%b %B%{$fg[black]%}%#%b %{$fg[black]%}%B%U%~%u%b%{$fg[black]%}%B > %b"
  71. #------------------------------------------////
  72. # Proxy:
  73. #------------------------------------------////
  74. #http_proxy=http://127.0.0.1:8118/
  75. #HTTP_PROXY=$http_proxy
  76. #export http_proxy HTTP_PROXY
  77.  
  78. #------------------------------------------////
  79. # Aliases:
  80. #------------------------------------------////
  81. ## make ls list by size
  82. ##alias ls='du -s */* | sort -n'
  83. alias findbig='find . -type f -exec ls -s {} \; | sort -n -r | head -5'
  84. alias ls='ls -aF --color=always'
  85. alias la='ls -Al'
  86. alias lx='ls -lXB'
  87. alias lk='ls -lSr'
  88. alias lc='ls -lcr'
  89. alias lu='ls -lur'
  90. alias lr='ls -lR'
  91. alias lt='ls -ltr'
  92. alias lm='ls -al |more'
  93. alias sch='cat /sys/block/sda/queue/scheduler'
  94. alias rm='rm -i'
  95. alias startservice='sudo systemctl start'
  96. alias stopservice='sudo systemctl stop'
  97. alias restartservice='sudo systemctl restart'
  98. alias reloadservice='sudo systemctl --daemon-reload'
  99. alias enableservice='sudo systemctl enable'
  100. alias disableservice='sudo systemctl disable'
  101. alias installpkg='sudo pacman -S'
  102. alias removepkg='sudo pacman -Rscnd'
  103. alias syncpkg='sudo pacman -Sy'
  104. alias uppkg='sudo pacman -Su'
  105. #alias bp='sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness'
  106. alias pubkey='sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys'
  107. alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg'
  108. alias clean='find ./Musik -type d -empty -delete'
  109. alias wget='wget --proxy-user bolu13ip45 --proxy-password abc'
  110. alias curl='curl -x http://10.3.3.126:6666/ -U bolu13ip45:abc'
  111. alias ttytter='ttytter -ansi -notifytype=libnotify -notifies=dm,reply'
  112. alias grep='grep --color=auto'
  113. alias cleanconfig='sudo dpkg --purge $(COLUMNS=200 dpkg -l | grep "^rc" | tr -s ' ' | cut -d ' ' -f 2)'
  114. #------------------------------------------////
  115. # Functions and Scripts:
  116. #------------------------------------------////
  117. localnet ()
  118. {
  119. /sbin/ifconfig | awk /'inet addr/ {print $2}'
  120. echo ""
  121. /sbin/ifconfig | awk /'Bcast/ {print $3}'
  122. echo ""
  123. }
  124.  
  125. upinfo ()
  126. {
  127. echo -ne "$fg[white]uptime is $fg[yellow] \t\t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
  128. }
  129. cd()
  130. {
  131. if [ -n "$1" ]; then
  132. builtin cd "$@" && ls
  133. else
  134. builtin cd ~ && ls
  135. fi
  136. }
  137.  
  138. extract()
  139. {
  140. if [ -f "$1" ] ; then
  141. case "$1" in
  142. *.tar.bz2) tar xjf "$1" ;;
  143. *.tar.gz) tar xzf "$1" ;;
  144. *.tar.Z) tar xzf "$1" ;;
  145. *.bz2) bunzip2 "$1" ;;
  146. *.rar) unrar x "$1" ;;
  147. *.gz) gunzip "$1" ;;
  148. *.jar) unzip "$1" ;;
  149. *.tar) tar xf "$1" ;;
  150. *.tbz2) tar xjf "$1" ;;
  151. *.tgz) tar xzf "$1" ;;
  152. *.zip) unzip "$1" ;;
  153. *.Z) uncompress "$1" ;;
  154. *) echo "'$1' cannot be extracted." ;;
  155. esac
  156. else
  157. echo "'$1' is not a file."
  158. fi
  159. }
  160.  
  161. setopt AUTO_LIST
  162. setopt AUTO_MENU
  163. setopt MENU_COMPLETE
  164. #export LC_ALL=id_ID.UTF-8
  165. #export LANG=id_ID.UTF-8
  166. #export http_proxy="http://bolu13ip45:abc@10.3.3.126:6666/"
  167. #export https_proxy=$http_proxy
  168. #export ftp_proxy=$http_proxy
  169. #export rsync_proxy=$http_proxy
  170. export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
  171. autoload -U compinit
  172. compinit
  173.  
  174. # Completion caching
  175. zstyle ':completion::complete:*' use-cache on
  176. zstyle ':completion::complete:*' cache-path .zcache
  177. zstyle ':completion:*:cd:*' ignore-parents parent pwd
  178.  
  179. #Completion Options
  180. zstyle ':completion:*:match:*' original only
  181. zstyle ':completion::prefix-1:*' completer _complete
  182. zstyle ':completion:predict:*' completer _complete
  183. zstyle ':completion:incremental:*' completer _complete _correct
  184. zstyle ':completion:*' completer _complete _prefix _correct _prefix _match _approximate
  185.  
  186. # Path Expansion
  187. zstyle ':completion:*' expand 'yes'
  188. zstyle ':completion:*' squeeze-shlashes 'yes'
  189. zstyle ':completion::complete:*' '\\'
  190.  
  191. zstyle ':completion:*:*:*:default' menu yes select
  192. zstyle ':completion:*:*:default' force-list always
  193.  
  194. # GNU Colors ??/etc/DIR_COLORS?? ?????????????????????
  195. [ -f /etc/DIR_COLORS ] && eval $(dircolors -b /etc/DIR_COLORS)
  196. export ZLSCOLORS="${LS_COLORS}"
  197. zmodload zsh/complist
  198. zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
  199. zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
  200.  
  201. zstyle ':completion:*' completer _complete _match _approximate
  202. zstyle ':completion:*:match:*' original only
  203. zstyle ':completion:*:approximate:*' max-errors 1 numeric
  204.  
  205. compdef pkill=kill
  206. compdef pkill=killall
  207. zstyle ':completion:*:*:kill:*' menu yes select
  208. zstyle ':completion:*:processes' command 'ps -au$USER'
  209.  
  210. # Group matches and Describe
  211. zstyle ':completion:*:matches' group 'yes'
  212. zstyle ':completion:*:options' description 'yes'
  213. zstyle ':completion:*:options' auto-description '%d'
  214. zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m'
  215. zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m'
  216. zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m'
  217.  
  218.  
  219. #print -Pc '%B`figlet "Debian 7.1"%b`'
  220. #echo -e "$bold_color $fg[yellow]";figlet "Debian 7.1";
  221. #echo -n "$fg[white]Today is:\t\t$fg[yellow]" `date`; echo ""
  222. #echo -e "$fg[white]Kernel Information: \t$fg[yellow]" `uname -smr`
  223. #echo -ne "$fg[white]";upinfo;echo " "
  224. #echo -e "$fg[white]"; cal -3
  225. # End of lines added by compinstall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement