Skip to content

Instantly share code, notes, and snippets.

@ddfreyne ddfreyne/.zshrc
Created Dec 4, 2015

Embed
What would you like to do?
My zsh configuration
#!/usr/bin/env zsh
source ~/.profile
source ~/.zshrc-local
########## ZSH STUFF
autoload -U colors && colors
########## HISTORY
HISTSIZE=50000
SAVEHIST=50000
HISTFILE=~/.zsh_history
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_DUPS
setopt PROMPT_SUBST
########## PROMPT
COLOR_RESET="\%{\e[0m%}"
COLOR_BOX_0="\%{\e[48;5;208m\e[1;38;5;232m%}"
COLOR_BOX_1="\%{\e[48;5;202m\e[1;38;5;232m%}"
COLOR_BOX_2="\%{\e[48;5;196m\e[1;38;5;232m%}"
git_branch() {
if [[ -d .git || -d ../.git || -d ../../.git || -d ../../../.git ]]
then echo "$(print $COLOR_BOX_0) $(git rev-parse --abbrev-ref HEAD) $(print $COLOR_RESET) "
else echo ""
fi
}
PROMPT='$(print $COMPUTER_COLOR) $(print $COMPUTER_NAME) $(print $COLOR_RESET) '
RPROMPT='\
$(git_branch)\
$(print $COLOR_BOX_1) %25<…<%~%<< $(print $COLOR_RESET) \
$(print $COLOR_BOX_2) %D{%H:%M} $(print $COLOR_RESET)'
########## COLORS
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
########## KEY BINDINGS
bindkey -e
########## COMPLETION
fpath=(/usr/local/share/zsh-completions $fpath)
zstyle ':completion:*' completer _expand _complete
zstyle ':completion:*' group-name ''
zstyle ':completion:*' ignore-parents parent pwd
zstyle ':completion:*' insert-unambiguous true
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}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' menu select=1
zstyle ':completion:*' original false
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*' verbose true
zstyle :compinstall filename '/Users/ddfreyne/.zshrc'
autoload -Uz compinit
compinit
########## HISTORY
bindkey "\e[A" up-line-or-search
bindkey "\e[B" down-line-or-search
COMPUTER_NAME=tahont
COMPUTER_COLOR="\%{\e[48;5;196m\e[1;38;5;232m%}"
@5minpause

This comment has been minimized.

Copy link

commented Dec 4, 2015

I remember your colored boxes to be somewhere in the right corner, if I am correct? I can't seem to get that to work for my prompt. Thanks anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.