Advertisement
Guest User

zshrc

a guest
Sep 27th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.49 KB | None | 0 0
  1. ###############################################
  2. ####### ZSH configuration file #######
  3. ###############################################
  4.  
  5.  
  6. ##########################
  7. ## General Settings ##
  8. ##########################
  9. ## If not running interactively, don't do anything
  10. [[ $- != *i* ]] && return
  11.  
  12.  
  13. # Export
  14. export EDITOR=/usr/bin/nano
  15. export TERM=xterm-256color
  16.  
  17.  
  18.  
  19. ######################
  20. ## GnuPG Settings ##
  21. ######################
  22. ## Start the gpg-agent if not already running
  23. if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then
  24. gpg-connect-agent /bye >/dev/null 2>&1
  25. fi
  26.  
  27.  
  28. ## Set SSH to use gpg-agent
  29. unset SSH_AGENT_PID
  30. if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
  31. export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
  32. fi
  33.  
  34.  
  35. ## Set GPG TTY
  36. export GPG_TTY=$(tty)
  37. export GPG_AGENT_INFO="/usr/bin/pinentry-gtk-2"
  38.  
  39.  
  40. ## Refresh gpg-agent tty in case user switches into an X session
  41. gpg-connect-agent updatestartuptty /bye >/dev/null
  42.  
  43.  
  44.  
  45. ######################
  46. ## Aliases ##
  47. ######################
  48. alias ls='ls --color=auto'
  49. alias lc='colorls -1 -sd -r'
  50. alias lch='colorls -sd -A -r'
  51. alias grep='grep --color=auto'
  52. alias egrep='egrep --color=auto'
  53. alias pacaur='pacaur --noconfirm --noedit'
  54. alias gksumousepad='gksu dbus-launch mousepad'
  55. alias sudomousepad='sudo dbus-launch mousepad'
  56. alias gksugedit='gksu dbus-launch gedit'
  57. alias sudogedit='sudo dbus-launch gedit'
  58. alias pkglist='pacman -Qqe > ~/Verejné/Nastavenia/Arch/BALÍČKY/pkglist.txt'
  59. alias clock='tty-clock -c -C4 -f "%A %d-%m-%Y"'
  60. alias info='~/.config/i3/sys-info.sh'
  61. alias q='exit'
  62. alias s='sudo pacman --noconfirm -S'
  63. alias r='sudo pacman --noconfirm -R'
  64. alias ss='pacman -Ss'
  65. alias syu='sudo pacman -Syu'
  66. alias syyu='sudo pacman -Syyu'
  67. alias sc='sudo pacman -Sc'
  68. alias scc='sudo pacman -Scc'
  69. alias ro='sudo pacman --noconfirm -Rns $(pacman -Qtdq)'
  70. alias ru='sudo paccache -ruk0'
  71. alias cc='sudo paccache -r'
  72. alias ps='pacaur -Ss'
  73. alias pa='pacaur -Sy'
  74. alias pyu='pacaur -Syu'
  75. alias pyyu='pacaur -Syyu'
  76. alias pu='pacaur -u'
  77.  
  78.  
  79.  
  80. ##########################
  81. ## ZSH options ##
  82. ##########################
  83. #setopt NOHUP
  84. #setopt NOTIFY
  85. #setopt NO_FLOW_CONTROL
  86. setopt INC_APPEND_HISTORY SHARE_HISTORY
  87. setopt APPEND_HISTORY
  88. #setopt AUTO_LIST
  89. #setopt AUTO_REMOVE_SLASH
  90. #setopt AUTO_RESUME
  91. unsetopt BG_NICE
  92. setopt CORRECT
  93. setopt EXTENDED_HISTORY
  94. #setopt HASH_CMDS
  95. setopt MENUCOMPLETE
  96. setopt ALL_EXPORT
  97. setopt HIST_EXPIRE_DUPS_FIRST
  98. setopt HIST_IGNORE_DUPS
  99. setopt HIST_IGNORE_SPACE
  100. setopt HIST_VERIFY
  101. setopt SHARE_HISTORY
  102. setopt ALIASES
  103.  
  104.  
  105.  
  106. ######################
  107. ## History ##
  108. ######################
  109. ## Enable history
  110. if [ -z "$HISTFILE" ]; then
  111. HISTFILE=$HOME/.zsh_history
  112. fi
  113.  
  114.  
  115. ## Variables
  116. PATH="/usr/local/bin:/usr/local/sbin/:$PATH"
  117. HISTSIZE=1000
  118. SAVEHIST=1000
  119. HOSTNAME="`hostname`"
  120. LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:';
  121.  
  122.  
  123. ## Show history
  124. case $HIST_STAMPS in
  125. "mm/dd/yyyy") alias history='fc -fl 1' ;;
  126. "dd.mm.yyyy") alias history='fc -El 1' ;;
  127. "yyyy-mm-dd") alias history='fc -il 1' ;;
  128. *) alias history='fc -l 1' ;;
  129. esac
  130.  
  131.  
  132.  
  133. ######################
  134. ## SHELL Options ##
  135. ######################
  136. setopt notify globdots correct pushdtohome cdablevars autolist
  137. setopt correctall autocd recexact longlistjobs
  138. setopt autoresume histignoredups pushdsilent
  139. setopt autopushd pushdminus extendedglob rcquotes mailwarning
  140. unsetopt bgnice autoparamslash
  141.  
  142.  
  143.  
  144. ##############################
  145. ## Autoload ZSH modules ##
  146. ##############################
  147. autoload -U history-search-end
  148. zmodload -a zsh/stat stat
  149. zmodload -a zsh/zpty zpty
  150. zmodload -a zsh/zprof zprof
  151. #zmodload -ap zsh/mapfile mapfile
  152. zle -N history-beginning-search-backward-end history-search-end
  153. zle -N history-beginning-search-forward-end history-search-end
  154.  
  155.  
  156.  
  157. ##########################
  158. ## Key bindings ##
  159. ##########################
  160. autoload -U compinit
  161. compinit
  162. bindkey "^?" backward-delete-char
  163. bindkey '^[OH' beginning-of-line
  164. bindkey '^[OF' end-of-line
  165. bindkey '^[[5~' up-line-or-history
  166. bindkey '^[[6~' down-line-or-history
  167. bindkey "^[[A" history-beginning-search-backward-end
  168. bindkey "^[[B" history-beginning-search-forward-end
  169. bindkey "^r" history-incremental-search-backward
  170. bindkey ' ' magic-space # also do history expansion on space
  171. bindkey '^I' complete-word # complete on tab, leave expansion to _expand
  172. typeset -A key
  173. key[Delete]=${terminfo[kdch1]}
  174. [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
  175.  
  176.  
  177.  
  178. ##############################
  179. ## Source plugins ##
  180. ##############################
  181. source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
  182. #source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
  183.  
  184.  
  185.  
  186. ##############################
  187. ## ZSH Highlight ##
  188. ##############################
  189. ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
  190. ZSH_HIGHLIGHT_STYLES[cursor]='fg=bold'
  191. ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold'
  192. ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,bold'
  193. ZSH_HIGHLIGHT_STYLES[command]='fg=green'
  194. ZSH_HIGHLIGHT_STYLES[precommand]='fg=green'
  195. ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green'
  196. ZSH_HIGHLIGHT_STYLES[builtin]='fg=green'
  197. ZSH_HIGHLIGHT_STYLES[function]='fg=green'
  198. ZSH_HIGHLIGHT_STYLES[bracket-error]='fg=red,bold'
  199. ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]='fg=yellow,bold'
  200. ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'
  201. ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=magenta,bold'
  202. ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'
  203. ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=cyan,bold'
  204. ZSH_HIGHLIGHT_PATTERNS+=('rm -rf' 'fg=magenta,bold')
  205. ZSH_HIGHLIGHT_PATTERNS+=('sudo sh' 'fg=magenta,bold')
  206.  
  207.  
  208.  
  209. ##################################
  210. ## Prompt & Powerline ##
  211. ##################################
  212. POWERLEVEL9K_MODE='awesome-fontconfig'
  213. POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
  214. POWERLEVEL9K_SHORTEN_DIR_LENGTH=4
  215. POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon root_indicator dir dir_writable vcs)
  216. POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status os_icon)
  217. POWERLEVEL9K_TIME_FORMAT="%D{\uf017 %H:%M \uf073 %d.%m.%y}"
  218. POWERLEVEL9K_TIME_BACKGROUND="252"
  219. POWERLEVEL9K_TIME_FOREGROUND="238"
  220. POWERLEVEL9K_CUSTOM_OS_ICON="custom_os_icon"
  221. custom_os_icon(){
  222. echo -n '\uf17c'
  223. }
  224. POWERLEVEL9K_CUSTOM_OS_ICON_BACKGROUND="blue"
  225. POWERLEVEL9K_CUSTOM_OS_ICON_FOREGROUND="white"
  226. POWERLEVEL9K_TIME_BACKGROUND="252"
  227. POWERLEVEL9K_TIME_FOREGROUND="238"
  228. POWERLEVEL9K_OS_ICON_BACKGROUND="white"
  229. POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
  230. POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
  231. POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
  232. POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
  233. POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="white"
  234. POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="white"
  235. POWERLEVEL9K_STATUS_OK_BACKGROUND="green"
  236. POWERLEVEL9K_STATUS_OK_FOREGROUND="white"
  237. POWERLEVEL9K_STATUS_ERROR_BACKGROUND="red"
  238. POWERLEVEL9K_STATUS_ERROR_FOREGROUND="white"
  239. POWERLEVEL9K_RAM_NORMAL_BACKGROUND="yellow"
  240. POWERLEVEL9K_RAM_NORMAL_FOREGROUND="black"
  241. POWERLEVEL9K_RAM_WARNING_BACKGROUND="127"
  242. POWERLEVEL9K_RAM_WARNING_FOREGROUND="black"
  243. POWERLEVEL9K_RAM_CRITICAL_BACKGROUND="red"
  244. POWERLEVEL9K_RAM_CRITICAL_FOREGROUND="white"
  245. source ~/.config/powerline/themes/powerlevel9k/powerlevel9k.zsh-theme
  246. ZSH_THEME="powerlevel9k"
  247. export DEFAULT_USER="$USER"
  248.  
  249.  
  250.  
  251. ######################
  252. ## Other ##
  253. ######################
  254. #[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null
  255. neofetch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement