Skip to content

Instantly share code, notes, and snippets.

@denisdefreyne
Created December 4, 2015 09:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denisdefreyne/003a7a9c2a42bcfdd2d6 to your computer and use it in GitHub Desktop.
Save denisdefreyne/003a7a9c2a42bcfdd2d6 to your computer and use it in GitHub Desktop.
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
Copy link

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