Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## zsh config by eisfunke ##
- # Load
- autoload -Uz compinit colors
- compinit
- colors
- # Prompt
- P_CTH=202 # Machine theme color
- P_CPR=237 # Prompt/path color
- P_CPL=246 # Light prompt color
- P_CFN=15 # Font color
- P_CGRN=2 # Success green
- P_CRED=1 # Failure red
- P_NAME="%F{$P_CFN}%K{$P_CTH} %B%n%b@%m %k%f%F{$P_CTH}%K{$P_CPR}%k%f"
- P_END="%F{$P_CFN}%K{$P_CPR}%B %(!.#.$) %b%k%f%F{$P_CPR}%f "
- PROMPT=$P_NAME$P_END
- P_PATH="%F{$P_CPR}%f%F{$P_CFN}%K{$P_CPR} %3(C-…/-)%2d %f"
- P_SUCCESS="%F{$P_CGRN}%f%k%F{$P_CFN}%K{$P_CGRN}%B ✓ %b%k%f"
- P_FAIL="%F{$P_CRED}%f%k%F{$P_CFN}%K{$P_CRED}%B %? %b%k%f"
- P_EXC="%(0?.$P_SUCCESS.$P_FAIL)"
- RPROMPT=$P_PATH$P_EXC
- PROMPT_EOL_MARK=" %F{$P_CPR}%f%F{$P_CFN}%K{$P_CPR} EOL %k%f"
- # History (shared between processes)
- setopt SHARE_HISTORY
- setopt HIST_IGNORE_ALL_DUPS
- setopt NO_BANG_HIST
- HISTFILE=~/.zhist
- HISTSIZE=1000
- SAVEHIST=1000
- # Misc
- setopt AUTOCD
- setopt NO_BEEP
- setopt IGNORE_EOF
- # Set edit mode to emacs, enable del
- bindkey -e
- bindkey "^[[3~" delete-char
- bindkey "^[3;5~" delete-char
- # Aliases
- alias grep="grep --color=auto" # Run grep with colors
- alias mkdir="mkdir -p -v" # Make parent dirs too
- alias diff="colordiff" # Run diff with colors
- alias free="free -h" # Run free with human-readable sizes
- alias df="df -h" # Run df with human-readable sizes
- alias du="du -c -h" # Run du with human-readable sizes and total
- alias ec="echo $?" # Show last exit-code
- alias cp="cp -i"
- alias mv="mv -i"
- alias rm="rm -I"
- alias rmr="rm -I -r"
- alias ln="ln -i"
- alias ls="ls -hF --color=auto" # Run ls with indicators, human-readable sizes and colors
- alias lsa="ls -A" # Include hidden
- alias lsr="ls -R" # Run recursively
- alias ll="ls -l" # Show as list
- alias lla="ll -A" # Include hidden
- alias llx="ll -BX" # Sort by extension
- alias lls="ll -rS" # Sort by size
- alias lld="ll -rt" # Sort by date
- alias con="nmcli con up" # Connect network profile
- alias dcon="nmcli con down" # Disconnect network profile
- alias pup="sudo pacman -Syu" # Update system
- alias pin="sudo pacman -S" # Install package
- alias prm="sudo pacman -Rns" # Remove package and dependencies
- alias psr="pacman -Ss" # Search for a package
- alias pif="pacman -Sii" # Show package info
- alias pls="pacman -Q" # List installed packages
- alias plf="pacman -Ql" # List package's files
- alias plr="paclist" # List all package from a repo
- alias sst="sudo systemctl start" # Start a systemd service
- alias sre="sudo systemctl restart" # Restart a systemd service
- alias sen="sudo systemctl enable" # Enable a systemd service
- # TU compute servers
- alias -g csPu="lenzni01@plutonium.cs.tu-dortmund.de"
- alias -g csPo="lenzni01@polonium.cs.tu-dortmund.de"
- alias -g csPm="lenzni01@promethium.cs.tu-dortmund.de"
- alias -g csU="lenzni01@uran.cs.tu-dortmund.de"
- alias -g csTc="lenzni01@technetium.cs.tu-dortmund.de"
- alias -g csBh="lenzni01@bohrium.cs.tu-dortmund.de"
- ### Completion ###
- zstyle ':completion:*' completer _list _oldlist _expand _complete _ignored _match _correct _approximate _prefix
- # Listing & Menus
- 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.
- 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"
- 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"
- zstyle ':completion:*' menu yes select=5
- zstyle ':completion:*' list-color ''
- zstyle ':completion:*' old-list always
- zstyle ':completion:*' file-sort name
- zstyle ':completion:*' insert-unambiguous true
- # Misc
- setopt COMPLETE_IN_WORD
- setopt COMPLETE_ALIASES
- setopt EXTENDEDGLOB NOMATCH
- zstyle ':completion:*' completions 1
- zstyle ':completion:*' condition 1
- zstyle ':completion:*' expand prefix suffix
- zstyle ':completion:*' glob 1
- zstyle ':completion:*' ignore-parents parent pwd .. directory
- zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'l:|=* r:|=*'
- zstyle ':completion:*' max-errors 1
- zstyle ':completion:*' original false
- zstyle ':completion:*' substitute 1
- zstyle ':completion:*' use-compctl false # Disable old completion system
- zstyle ':completion:*' verbose true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement