Skip to content

Instantly share code, notes, and snippets.

@nweldev
Last active November 30, 2016 09:52
Show Gist options
  • Save nweldev/04772103626ea01aaf1a to your computer and use it in GitHub Desktop.
Save nweldev/04772103626ea01aaf1a to your computer and use it in GitHub Desktop.
another .bashrc file formerly used at work on Mac OS X
export no_proxy='usine.fdj.fr,192.168.120.96'
stty cs8 -istrip -parenb
bind 'set convert-meta off'
bind 'set meta-flag on'
bind 'set output-meta on'
# TODO : updatedb at first connection
# Reset
Color_Off='\[\e[0m\]' # Text Reset
# Regular Colors
Black='\[\e[0;30m\]' # Black
Red='\[\e[31m\]' # Red
Green='\[\e[0;32m\]' # Green
Yellow='\[\e[0;33m\]' # Yellow
Blue='\[\e[0;34m\]' # Blue
Purple='\[\e[0;35m\]' # Purple
Cyan='\[\e[0;36m\]' # Cyan
White='\[\e[0;37m\]' # White
# Bold
BBlack='\e[1;30m' # Black
BRed='\e[1;31m' # Red
BGreen='\e[1;32m' # Green
BYellow='\e[1;33m' # Yellow
BBlue='\e[1;34m' # Blue
BPurple='\e[1;35m' # Purple
BCyan='\e[1;36m' # Cyan
BWhite='\e[1;37m' # White
# Underline
UBlack='\e[4;30m' # Black
URed='\e[4;31m' # Red
UGreen='\e[4;32m' # Green
UYellow='\e[4;33m' # Yellow
UBlue='\e[4;34m' # Blue
UPurple='\e[4;35m' # Purple
UCyan='\e[4;36m' # Cyan
UWhite='\e[4;37m' # White
# Background
On_Black='\e[40m' # Black
On_Red='\e[41m' # Red
On_Green='\e[42m' # Green
On_Yellow='\e[43m' # Yellow
On_Blue='\e[44m' # Blue
On_Purple='\e[45m' # Purple
On_Cyan='\e[46m' # Cyan
On_White='\e[47m' # White
# High Intensity
IBlack='\[\e[0;90m\]' # Black
IRed='\[\e[0;91m\]' # Red
IGreen='\[\e[0;92m\]' # Green
IYellow='\[\e[0;93m\]' # Yellow
IBlue='\[\e[0;94m\]' # Blue
IPurple='\[\e[0;95m\]' # Purple
ICyan='\[\e[0;96m\]' # Cyan
IWhite='\[\e[0;97m\]' # White
# Bold High Intensity
BIBlack='\[\e[1;90m\]' # Black
BIRed='\[\e[1;91m\]' # Red
BIGreen='\[\e[1;92m\]' # Green
BIYellow='\[\e[1;93m\]' # Yellow
BIBlue='\[\e[1;94m\]' # Blue
BIPurple='\[\e[1;95m\]' # Purple
BICyan='\[\e[1;96m\]' # Cyan
BIWhite='\[\e[1;97m\]' # White
# High Intensity backgrounds
On_IBlack='\[\e[0;100m\]' # Black
On_IRed='\[\e[0;101m\]' # Red
On_IGreen='\[\e[0;102m\]' # Green
On_IYellow='\[\e[0;103m\]' # Yellow
On_IBlue='\[\e[0;104m\]' # Blue
On_IPurple='\[\e[0;105m\]' # Purple
On_ICyan='\[\e[0;106m\]' # Cyan
On_IWhite='\[\e[0;107m\]' # White
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
alias updatedb="gupdatedb --localpaths='/Users/nmace' --output='/Users/nmace/tmp/locatedb'"
alias locate="glocate"
export LC_ALL='C'
export LOCATE_PATH="/Users/nmace/tmp/locatedb"
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1="${Green}\u${Color_Off}@${Red}\h${Color_Off}:${Blue}\W ${Yellow}\$(__git_ps1)${Color_Off}$ "
else
PS1='$\u@\h:\W\$ '
fi
unset color_prompt force_color_prompt
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
if [ -x /usr/bin/git ]; then
alias gpl='git pull'
alias gps='git push'
alias g='git status'
alias gc='git commit'
alias gm='git merge'
alias gck='git checkout'
alias ga='git add'
alias gaa='git add .'
alias gl='git log'
alias gb='git branch'
gitrmbd () {
pattern="$1";
git branch -r --merged | grep -E "origin/$pattern" | sed 's/origin\///g';
echo 'confirmer la suppression de ces branches distantes ? (N/y)';
read response;
if [ "$response" == "y" ]; then
git push origin --delete `git branch -r --merged | grep -E "origin/$pattern" | sed 's/origin\///g'`;
fi
}
gitrmb () {
pattern="$1";
git branch --merged | grep -v "$pattern"
echo 'confirmer la suppression de ces branches locales ? (N/y)';
read response;
if [ "$response" == "y" ]; then
git branch -d `git branch --merged | grep -v "$pattern"`
fi
}
fi
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias nodee6="node --use-strict $(node --v8-options | grep harm | awk '{print $1}' | xargs)"
# eval "$(grunt --completion=bash)"
alias printenv_all='( set -o posix ; set ) | less'
# FIXME
#source $HOME/.bashrc.d/*
bashrcd=$HOME/.bashrc.d
# see https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
source $bashrcd/git-prompt.sh
source $bashrcd/gogit.sh
# This is Git's per-user configuration file.
[core]
# Please adapt and uncomment the following lines:
# user = Noel Mace
# email = [email protected]
user=noelmace
[email protected]
[log]
date = relative
[format]
pretty = format:%C(yellow)%h %Cblue%>(14)%ad %Cgreen%<(15)%aN%Cred%d %Creset%s
[alias]
# Beautiful logs
# from http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs
#quick look at all repo
loggsa = log --color --date-order --graph --pretty=format:'%C(yellow)%h %Cgreen%aN%Cred%d %Creset%s' --decorate --simplify-by-decoration --all
#quick look at active branch (or refs pointed)
loggs = log --color --date-order --graph --oneline --decorate --simplify-by-decoration
#extend look at all repo
logga = log --color --date-order --graph --oneline --decorate --all
#extend look at active branch
logg = log --color --date-order --graph --oneline --decorate
#Look with date
logda = log --color --date-order --date=local --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ad%Creset %C(auto)%d%Creset %s\" --all
logd = log --color --date-order --date=local --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ad%Creset %C(auto)%d%Creset %s\"
#Look with relative date
logdra = log --color --date-order --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ar%Creset %C(auto)%d%Creset %s\" --all
logdr = log --color --date-order --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ar%Creset %C(auto)%d%Creset %s\"
[user]
email = [email protected]
name = Noel Mace
[push]
default = simple
*
!\ Work-config
!.gitignore
!.bashrc
!.gitconfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment