Skip to content

Instantly share code, notes, and snippets.

@MartyLake
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartyLake/4afbde918903f6582453 to your computer and use it in GitHub Desktop.
Save MartyLake/4afbde918903f6582453 to your computer and use it in GitHub Desktop.
ZSH conf
#!/bin/bash
#a black
#b red
#c green
#d brown
#e blue
#f magenta
#g cyan
#h light grey
#A bold black, usually shows up as dark grey
#B bold red
#C bold green
#D bold brown, usually shows up as yellow
#E bold blue
#F bold magenta
#G bold cyan
#H bold light grey; looks like bright white
#x default foreground or background
DIRECTORY="ex"
SYMBLINK="gx"
SOCKET="xx"
PIPE="xx"
EXEC="cx"
BLCKSPE="xx"
CHARSPE="xx"
EXECSUID="cx"
EXECSGID="cx"
DIRWSB="xd"
DIRW="xd"
LSCOLORS="$DIRECTORY$SYMBLINK$SOCKET$PIPE$EXEC$BLCKSPE$CHARSPE$EXECSUID$EXECSGID$DIRWSB$DIRWd"
export LSCOLORS
PATH=/usr/local/bin:$HOME/.brew/bin:$PATH
setopt inc_append_history
setopt share_history
if [[ -f ~/.myzshrc ]]; then
source ~/.myzshrc
fi
alias mcd='mkdir \!*; cd \!*'
alias pc='pwd | pbcopy'
alias pp='cd `pbpaste`'
alias ls='ls -G'
alias l='ls -l'
alias la='ls -lA'
alias rl='source ~/.zshrc'
function cd () { builtin cd "$*" && ls ; }
# Gestion de l'historique
HISTFILE=~/.zshrc_history
SAVEHIST=5000
HISTSIZE=5000
setopt inc_append_history
setopt share_history
# Correction de la touche Delete
bindkey "\e[3~" delete-char
# Autocompletion de type menu
autoload -U compinit && compinit
zstyle ':completion:*' menu select
# Couleur prompt
autoload -U colors && colors
# Definition des couleurs
source ~/.ls_colors
# Definition du prompt
PROMPT="%{$fg[red]%}%T%{$reset_color%} %m %{$fg[cyan]%}%~%{$reset_color%} > "
precmd ()
{
ISGIT=$(git status 2> /dev/null)
if [ -n "$ISGIT" ]
then
STATUS=$(echo "$ISGIT" | grep "modified")
if [ -n "$STATUS" ]
then
COLOR="%{$fg[red]%}"
else
COLOR="%{$fg[green]%}"
fi
NORMAL="%{$reset_color%}"
BRANCH=$(git branch | cut -d ' ' -f 2 | tr -d '\n')
RPROMPT="%{$COLOR%}($BRANCH)%{$NORMAL%}"
else
RPROMPT=""
fi
}
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment