Advertisement
martadinata

zshrc 13jan2019

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