Advertisement
Guest User

Untitled

a guest
May 28th, 2017
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. ## zsh config by eisfunke ##
  2.  
  3. # Load
  4. autoload -Uz compinit colors
  5. compinit
  6. colors
  7.  
  8. # Prompt
  9. P_CTH=202 # Machine theme color
  10. P_CPR=237 # Prompt/path color
  11. P_CPL=246 # Light prompt color
  12. P_CFN=15 # Font color
  13. P_CGRN=2 # Success green
  14. P_CRED=1 # Failure red
  15.  
  16. P_NAME="%F{$P_CFN}%K{$P_CTH} %B%n%b@%m %k%f%F{$P_CTH}%K{$P_CPR}%k%f"
  17. P_END="%F{$P_CFN}%K{$P_CPR}%B %(!.#.$) %b%k%f%F{$P_CPR}%f "
  18. PROMPT=$P_NAME$P_END
  19.  
  20. P_PATH="%F{$P_CPR}%f%F{$P_CFN}%K{$P_CPR} %3(C-…/-)%2d %f"
  21. P_SUCCESS="%F{$P_CGRN}%f%k%F{$P_CFN}%K{$P_CGRN}%B ✓ %b%k%f"
  22. P_FAIL="%F{$P_CRED}%f%k%F{$P_CFN}%K{$P_CRED}%B %? %b%k%f"
  23. P_EXC="%(0?.$P_SUCCESS.$P_FAIL)"
  24. RPROMPT=$P_PATH$P_EXC
  25.  
  26. PROMPT_EOL_MARK=" %F{$P_CPR}%f%F{$P_CFN}%K{$P_CPR} EOL %k%f"
  27.  
  28. # History (shared between processes)
  29. setopt SHARE_HISTORY
  30. setopt HIST_IGNORE_ALL_DUPS
  31. setopt NO_BANG_HIST
  32. HISTFILE=~/.zhist
  33. HISTSIZE=1000
  34. SAVEHIST=1000
  35.  
  36. # Misc
  37. setopt AUTOCD
  38. setopt NO_BEEP
  39. setopt IGNORE_EOF
  40.  
  41. # Set edit mode to emacs, enable del
  42. bindkey -e
  43. bindkey "^[[3~" delete-char
  44. bindkey "^[3;5~" delete-char
  45.  
  46. # Aliases
  47. alias grep="grep --color=auto" # Run grep with colors
  48. alias mkdir="mkdir -p -v" # Make parent dirs too
  49. alias diff="colordiff" # Run diff with colors
  50. alias free="free -h" # Run free with human-readable sizes
  51. alias df="df -h" # Run df with human-readable sizes
  52. alias du="du -c -h" # Run du with human-readable sizes and total
  53. alias ec="echo $?" # Show last exit-code
  54.  
  55. alias cp="cp -i"
  56. alias mv="mv -i"
  57. alias rm="rm -I"
  58. alias rmr="rm -I -r"
  59. alias ln="ln -i"
  60.  
  61. alias ls="ls -hF --color=auto" # Run ls with indicators, human-readable sizes and colors
  62. alias lsa="ls -A" # Include hidden
  63. alias lsr="ls -R" # Run recursively
  64. alias ll="ls -l" # Show as list
  65. alias lla="ll -A" # Include hidden
  66. alias llx="ll -BX" # Sort by extension
  67. alias lls="ll -rS" # Sort by size
  68. alias lld="ll -rt" # Sort by date
  69.  
  70. alias con="nmcli con up" # Connect network profile
  71. alias dcon="nmcli con down" # Disconnect network profile
  72.  
  73. alias pup="sudo pacman -Syu" # Update system
  74. alias pin="sudo pacman -S" # Install package
  75. alias prm="sudo pacman -Rns" # Remove package and dependencies
  76. alias psr="pacman -Ss" # Search for a package
  77. alias pif="pacman -Sii" # Show package info
  78. alias pls="pacman -Q" # List installed packages
  79. alias plf="pacman -Ql" # List package's files
  80. alias plr="paclist" # List all package from a repo
  81.  
  82. alias sst="sudo systemctl start" # Start a systemd service
  83. alias sre="sudo systemctl restart" # Restart a systemd service
  84. alias sen="sudo systemctl enable" # Enable a systemd service
  85.  
  86. # TU compute servers
  87. alias -g csPu="lenzni01@plutonium.cs.tu-dortmund.de"
  88. alias -g csPo="lenzni01@polonium.cs.tu-dortmund.de"
  89. alias -g csPm="lenzni01@promethium.cs.tu-dortmund.de"
  90. alias -g csU="lenzni01@uran.cs.tu-dortmund.de"
  91. alias -g csTc="lenzni01@technetium.cs.tu-dortmund.de"
  92. alias -g csBh="lenzni01@bohrium.cs.tu-dortmund.de"
  93.  
  94.  
  95. ### Completion ###
  96. zstyle ':completion:*' completer _list _oldlist _expand _complete _ignored _match _correct _approximate _prefix
  97.  
  98. # Listing & Menus
  99. zstyle ':completion:*' format "%F{$P_CFN}%K{$P_CPR} Completing %k%f%F{$P_CPR}%f %d" # Notification above completion menu. %d is thing being completed.
  100. zstyle ':completion:*' list-prompt "%F{$P_CFN}%K{$P_CPR} Listing %k%f%K{$P_CPL}%F{$P_CPR}%f%F{$P_CFN} Enter next character %f%k%F{$P_CPL}%f At %p"
  101. zstyle ':completion:*' select-prompt "%F{$P_CFN}%K{$P_CPR} Selecting %k%f%K{$P_CPL}%F{$P_CPR}%f%F{$P_CFN} Choose option %f%k%F{$P_CPL}%f At %p"
  102. zstyle ':completion:*' menu yes select=5
  103. zstyle ':completion:*' list-color ''
  104. zstyle ':completion:*' old-list always
  105. zstyle ':completion:*' file-sort name
  106. zstyle ':completion:*' insert-unambiguous true
  107.  
  108. # Misc
  109. setopt COMPLETE_IN_WORD
  110. setopt COMPLETE_ALIASES
  111. setopt EXTENDEDGLOB NOMATCH
  112. zstyle ':completion:*' completions 1
  113. zstyle ':completion:*' condition 1
  114. zstyle ':completion:*' expand prefix suffix
  115. zstyle ':completion:*' glob 1
  116. zstyle ':completion:*' ignore-parents parent pwd .. directory
  117. zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'l:|=* r:|=*'
  118. zstyle ':completion:*' max-errors 1
  119. zstyle ':completion:*' original false
  120. zstyle ':completion:*' substitute 1
  121. zstyle ':completion:*' use-compctl false # Disable old completion system
  122. zstyle ':completion:*' verbose true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement