Skip to content

Instantly share code, notes, and snippets.

@sygo
Last active September 25, 2015 02:07
Show Gist options
  • Save sygo/844984 to your computer and use it in GitHub Desktop.
Save sygo/844984 to your computer and use it in GitHub Desktop.
bashrc
#-- be done if it's not an interactive session --#
[ -z "$PS1" ] && return
#-- prompt --#
PNORMAL='\[\033[00m\]'
PGREEN='\[\033[0;32m\]'
PRED='\[\033[0;31m\]'
PBLUE='\[\033[0;34m\]'
#PS1=['$?:${PWD#${PWD%/*/*/*}/}> '
PS1="${PNORMAL}[${PGREEN}\u@\h${PNORMAL}][${PRED}\l${PNORMAL}][${PBLUE}\W${PNORMAL}]> "
#-- exports --#
export EDITOR="vim"
export BROWSER="firefox"
export PATH=$PATH:$HOME/scripts:/usr/local/bin:
export SB_REMOVE_BEL=yes
export HISTCONTROL="ignoredupes"
export COMMAND_ORIENTED_HISTORY=1
#-- Aliases --#
alias ls='ls --color=auto'
alias pbcopy='xsel --clipboard --input'
alias pbpaste='xsel --clipboard --output'
alias grep='grep --color=auto'
alias gay='grc -es --colour=auto'
alias Woopra='wmname LG3D && Woopra'
#-- lol pacman --#
alias canihaz='sudo pacman -S'
alias donotwant='sudo pacman -R'
#-- functions --#
findme() {
echo -e "$(pacman -Ss $@ | sed \
-e 's#core/.*#\\033[1;31m&\\033[0;37m#g' \
-e 's#extra/.*#\\033[0;32m&\\033[0;37m#g' \
-e 's#community/.*#\\033[1;35m&\\033[0;37m#g' \
-e 's#^.*/.* [0-9].*#\\033[0;36m&\\033[0;37m#g' )"
}
mkcd () { mkdir -p "$@" && cd "$@"; }
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
#-- fing rainbows how do they work? --#
alias configure='gay ./configure'
alias diff='gay diff'
alias make='gay make'
alias gcc='gay gcc'
alias g++='gay g++'
alias cvs='gay cvs'
alias as='gay as'
alias ld='gay ld'
alias netstat='gay netstat'
alias ping='gay ping'
alias traceroute='gay traceroute'
alias tail='gay tail'
alias nmap='gay nmap'
alias ps='gay ps'
#-- colored man pages --#
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'
#-- shopt goodness --#
shopt -s cdspell # try to correct typos in path
shopt -s histappend # append history don't overwrite it
shopt -s checkwinsize # check terminal size after each command
shopt -s dotglob # include dotfiles in path expansion
shopt -s hostcomplete # try to autocomplete hostnames
#-- sudo tab completion --#
complete -cf sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment