Commit 99fd6132 authored by Robert Spencer's avatar Robert Spencer
Browse files

Merge individual files

parent 7aca0bcf
# Set the directory where we're being loaded from
AZS_DIR=$(dirname "$0")
# Locate and load zshrc files
find "$AZS_DIR"/zshrc.d -type f -name "*.zsh" | sort | while read rc_file; do
source "$rc_file"
done
# Override first bin directory
if [ -d "$HOME/.local/bin" ]
then
if ! [[ "$PATH" =~ "$HOME/.local/bin" ]]
then
export PATH="$HOME/.local/bin:$PATH"
fi
else
# We should never need this, but just in case
mkdir -p "$HOME/.local/bin"
if ! [[ "$PATH" =~ "$HOME/.local/bin" ]]
then
export PATH="$HOME/.local/bin:$PATH"
fi
fi
# Remove duplicates in $PATH, if they exist
typeset -U path
## Configure the history
# The following line changes the command execution time stamp shown in
# the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS='%Y/%m/%d'
# Don't store invocations of 'history' in the history
setopt HIST_NO_STORE
# Enable incremental append
setopt INC_APPEND_HISTORY
## Long running
# If a command takes a combined time of > 10 seconds, zsh will report it...
REPORTTIME=10
## Aliases
# Override grml's setting for dir
alias dir='dir --color=auto'
# Add colour
alias vdir='vdir --color=auto'
alias fgrep='fgrep --color=auto'
# Make sure we ask before every use of our key
alias ssh-add='/usr/bin/ssh-add -c -t 1800'
# Use ksshaskpass if it exists and we're using the plasma desktop
if [[ "$DESKTOP_SESSION" =~ "plasma" ]]
then
if [ -x /usr/bin/ksshaskpass ]
then
# Use KDE askpass
export SSH_ASKPASS=/usr/bin/ksshaskpass
echo "[awit-zsh-superawesome] Using ksshaskpass"
else
echo "[awit-zsh-superawesome] NOTICE: You're using the plasma desktop, but you don't have ksshaskpass installed?"
fi
fi
# Use keychain if installed
if [ -x /usr/bin/keychain ]
then
eval `keychain --confirm --clear --noask --timeout 15 --eval --systemd --stop others --quiet --inherit local-once --agents ssh`
echo "[awit-zsh-superawesome] Using keychain (15 min timeout, explicit confirmation)"
fi
## Completion
# A handy-dandy function for reloading completions we might hack on
function compreload() {
ARG="$1"
unfunction _$ARG
autoload _$ARG
}
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' use-compctl false
# Add custom completion scripts
if [ -d "$HOME/.zsh/completion" ]
then
fpath=($HOME/.zsh/completion $fpath)
fi
## Oh-my-zsh
plugins=(
colored-man-pages
colorize
command-not-found
gitfast
screen
virtualenv
zsh-syntax-highlighting
)
# Allow theming if we're running in a desktop session
if [[ "$DESKTOP_SESSION" =~ "plasma" ]]
then
# Set oh my zsh theme
ZSH_THEME="powerlevel9k"
# Setup powerlevel9k
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs virtualenv)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator command_execution_time background_jobs history time)
POWERLEVEL9K_MODE=nerdfont-complete
# Shorten directory length
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
# Fix up icons a bit
POWERLEVEL9K_OS_ICON_BACKGROUND="white"
POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
# Fix icon widths
POWERLEVEL9K_HOME_SUB_ICON="\uE18D "
POWERLEVEL9K_AWS_ICON="\uF270 "
POWERLEVEL9K_TEST_ICON="\uF188 "
POWERLEVEL9K_TODO_ICON="\uF133 "
POWERLEVEL9K_DISK_ICON="\uF0A0 "
POWERLEVEL9K_OK_ICON="\uF00C "
POWERLEVEL9K_SYMFONY_ICON="\uE757 "
POWERLEVEL9K_APPLE_ICON="\uF179 "
POWERLEVEL9K_WINDOWS_ICON="\uF17A "
POWERLEVEL9K_ANDROID_ICON="\uF17B "
POWERLEVEL9K_LINUX_ICON="\uF17C "
POWERLEVEL9K_HOME_ICON="\uF015 "
POWERLEVEL9K_HOME_SUB_ICON="\uF07C "
POWERLEVEL9K_FOLDER_ICON="\uF115 "
POWERLEVEL9K_NETWORK_ICON="\uF1EB "
POWERLEVEL9K_SWAP_ICON="\uF464 "
POWERLEVEL9K_RAM_ICON="\uF0E4 "
POWERLEVEL9K_SERVER_ICON="\uF0AE "
POWERLEVEL9K_VCS_UNTRACKED_ICON="\uF059 "
POWERLEVEL9K_VCS_UNSTAGED_ICON="\uF06A "
POWERLEVEL9K_VCS_STAGED_ICON="\uF055 "
POWERLEVEL9K_SWIFT_ICON="\uE755 "
POWERLEVEL9K_PUBLIC_IP_ICON="\UF0AC "
POWERLEVEL9K_EXECUTION_TIME_ICON="\uF252 "
POWERLEVEL9K_SSH_ICON="\uF489 "
# Add highlight color to prompt
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
typeset -gA ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[cursor]='bold'
ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[function]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[command]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green,bold'
fi
## Variables
# Useful variables for our ZSH environment
test "x$HOSTNAME" = "x" && export HOSTNAME="$HOST"
export GIT_EDITOR="$EDITOR"
export VISUAL="$EDITOR"
## Load Oh-my-zsh [This needs to be last]
# Path to your oh-my-zsh installation
ZSH=/usr/share/oh-my-zsh/
# Custom directory
ZSH_CUSTOM="$AZS_DIR/custom"
# Disable bi-weekly auto-update checks
DISABLE_AUTO_UPDATE="true"
COMPLETION_WAITING_DOTS="true"
# Pull in the system oh-my-zsh
source "$ZSH/oh-my-zsh.sh"
# Override first bin directory
if [ -d "$HOME/.local/bin" ]
then
if ! [[ "$PATH" =~ "$HOME/.local/bin" ]]
then
export PATH="$HOME/.local/bin:$PATH"
fi
else
# We should never need this, but just in case
mkdir -p "$HOME/.local/bin"
if ! [[ "$PATH" =~ "$HOME/.local/bin" ]]
then
export PATH="$HOME/.local/bin:$PATH"
fi
fi
# Remove duplicates in $PATH, if they exist
typeset -U path
# The following line changes the command execution time stamp shown in
# the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS='%Y/%m/%d'
## Configure the history.
# Don't store invocations of 'history' in the history
setopt HIST_NO_STORE
# Enable incremental append
setopt INC_APPEND_HISTORY
# If a command takes a combined time of > 10 seconds, zsh will report it...
REPORTTIME=10
# Add directory colors
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias fgrep='fgrep --color=auto'
# Use ksshaskpass if it exists and we're using the plasma desktop
if [[ "$DESKTOP_SESSION" =~ "plasma" ]]
then
if [ -x /usr/bin/ksshaskpass ]
then
# Use KDE askpass
export SSH_ASKPASS=/usr/bin/ksshaskpass
echo "[awit-zsh-superawesome] Using ksshaskpass"
else
echo "[awit-zsh-superawesome] NOTICE: You're using the plasma desktop, but you don't have ksshaskpass installed?"
fi
fi
# Use keychain if installed
if [ -x /usr/bin/keychain ]
then
eval `keychain --confirm --clear --noask --timeout 15 --eval --systemd --stop others --quiet --inherit local-once --agents ssh`
echo "[awit-zsh-superawesome] Using keychain (15 min timeout, explicit confirmation)"
fi
# A handy-dandy function for reloading completions we might hack on
function compreload() {
ARG="$1"
unfunction _$ARG
autoload _$ARG
}
zstyle ':completion:*' auto-description 'specify: %d'
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*' format 'Completing %d'
#zstyle ':completion:*' group-name ''
# For autocompletion with an arrow-key driven interface. ?
# To activate the menu, press Tab twice.
#zstyle ':completion:*' menu select=2
#eval "$(dircolors -b)"
#zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
#zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
#zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
#zstyle ':completion:*' menu select=long
#zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' use-compctl false
zstyle ':completion:*' verbose true
#zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
#zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
# Add custom completion scripts
if [ -d "$HOME/.zsh/completion" ]
then
fpath=($HOME/.zsh/completion $fpath)
fi
plugins=(
colored-man-pages
colorize
command-not-found
gitfast
screen
virtualenv
zsh-syntax-highlighting
)
# Abort theming if we're not running in a desktop session
if [ -z "$DESKTOP_SESSION" ]; then
return
fi
# Set oh my zsh theme
ZSH_THEME="powerlevel9k"
# Setup powerlevel9k
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs virtualenv)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator command_execution_time background_jobs history time)
POWERLEVEL9K_MODE=nerdfont-complete
# Shorten directory length
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
# Fix up icons a bit
POWERLEVEL9K_OS_ICON_BACKGROUND="white"
POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
# Fix icon widths
POWERLEVEL9K_HOME_SUB_ICON="\uE18D "
POWERLEVEL9K_AWS_ICON="\uF270 "
POWERLEVEL9K_TEST_ICON="\uF188 "
POWERLEVEL9K_TODO_ICON="\uF133 "
POWERLEVEL9K_DISK_ICON="\uF0A0 "
POWERLEVEL9K_OK_ICON="\uF00C "
POWERLEVEL9K_SYMFONY_ICON="\uE757 "
POWERLEVEL9K_APPLE_ICON="\uF179 "
POWERLEVEL9K_WINDOWS_ICON="\uF17A "
POWERLEVEL9K_ANDROID_ICON="\uF17B "
POWERLEVEL9K_LINUX_ICON="\uF17C "
POWERLEVEL9K_HOME_ICON="\uF015 "
POWERLEVEL9K_HOME_SUB_ICON="\uF07C "
POWERLEVEL9K_FOLDER_ICON="\uF115 "
POWERLEVEL9K_NETWORK_ICON="\uF1EB "
POWERLEVEL9K_SWAP_ICON="\uF464 "
POWERLEVEL9K_RAM_ICON="\uF0E4 "
POWERLEVEL9K_SERVER_ICON="\uF0AE "
POWERLEVEL9K_VCS_UNTRACKED_ICON="\uF059 "
POWERLEVEL9K_VCS_UNSTAGED_ICON="\uF06A "
POWERLEVEL9K_VCS_STAGED_ICON="\uF055 "
POWERLEVEL9K_SWIFT_ICON="\uE755 "
POWERLEVEL9K_PUBLIC_IP_ICON="\UF0AC "
POWERLEVEL9K_EXECUTION_TIME_ICON="\uF252 "
POWERLEVEL9K_SSH_ICON="\uF489 "
# Useful variables for our ZSH environment
test "x$HOSTNAME" = "x" && export HOSTNAME="$HOST"
export GIT_EDITOR="$EDITOR"
export VISUAL="$EDITOR"
# Path to your oh-my-zsh installation
ZSH=/usr/share/oh-my-zsh/
# Custom directory
ZSH_CUSTOM="$AZS_DIR/custom"
# Disable bi-weekly auto-update checks
DISABLE_AUTO_UPDATE="true"
COMPLETION_WAITING_DOTS="true"
# Pull in the system oh-my-zsh
source "$ZSH/oh-my-zsh.sh"
# Make sure we ask before every use of our key
alias ssh-add='/usr/bin/ssh-add -c -t 1800'
# Add highlight color to prompt
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)
typeset -gA ZSH_HIGHLIGHT_STYLES
ZSH_HIGHLIGHT_STYLES[cursor]='bold'
ZSH_HIGHLIGHT_STYLES[alias]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[suffix-alias]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[builtin]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[function]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[command]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[precommand]='fg=green,bold'
ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=green,bold'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment