summaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc90
1 files changed, 90 insertions, 0 deletions
diff --git a/bashrc b/bashrc
new file mode 100644
index 0000000..7fbafa3
--- /dev/null
+++ b/bashrc
@@ -0,0 +1,90 @@
+#
+# ~/.bashrc
+#
+
+# editor
+export EDITOR="vim"
+
+# if not running interactively, don't do anything
+[[ $- != *i* ]] && return
+
+# set history variables
+HISTCONTROL=ignoreboth:erasedups
+HISTSIZE=10000
+HISTFILESIZE=10000
+
+# bash completion
+if [ -f /etc/bash_completion ]; then
+ . /etc/bash_completion
+fi
+
+# PS1
+if [[ $EUID -eq 0 ]]
+then
+ PS1='\[\e[1;31m\]\u\[\e[0m\]@\[\e[0;37m\]\h\[\e[0m\] \[\e[0;34m\]\w\[\e[0m\] \[\e[0;37m\]>\[\e[0m\] '
+else
+ PS1='\[\e[0;32m\]\u\[\e[0m\]@\[\e[33m\]\h\[\e[0m\] \[\e[0;34m\]\w\[\e[0m\] \[\e[0;37m\]>\[\e[0m\] '
+fi
+
+# aliases
+alias df='dfc'
+alias ls='ls -lisa --group-directories-first --color=auto'
+alias free='free -h'
+alias grep='grep --color=auto'
+
+# manpage 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'
+
+# console colors
+if [ "$TERM" = "linux" ]; then
+ echo -en "\e]P0000000" #black
+ echo -en "\e]P8505354" #darkgrey
+ echo -en "\e]P1F92672" #darkred
+ echo -en "\e]P9FF5995" #red
+ echo -en "\e]P282B414" #darkgreen
+ echo -en "\e]PAB6E354" #green
+ echo -en "\e]P3FD971F" #darkyellow
+ echo -en "\e]PBFEED6C" #yellow
+ echo -en "\e]P44E82AA" #darkblue
+ echo -en "\e]PC0C73C2" #blue
+ echo -en "\e]P58C54FE" #darkmagenta
+ echo -en "\e]PD9E6FFE" #magenta
+ echo -en "\e]P6465457" #darkcyan
+ echo -en "\e]PE899CA1" #cyan
+ echo -en "\e]P7CCCCC6" #lightgrey
+ echo -en "\e]PFF8F8F2" #white
+ clear # bring us back to default input colours
+fi
+
+# unpack/extract files
+unp () {
+ if [ -f $1 ] ; then
+ case $1 in
+ *.tar.bz2) tar xvjf $1 ;;
+ *.tar.gz) tar xvzf $1 ;;
+ *.tar.xz) tar xvJf $1 ;;
+ *.bz2) bunzip2 $1 ;;
+ *.rar) unrar x $1 ;;
+ *.gz) gunzip $1 ;;
+ *.tar) tar xvf $1 ;;
+ *.tbz2) tar xvjf $1 ;;
+ *.tgz) tar xvzf $1 ;;
+ *.zip) unzip $1 ;;
+ *.Z) uncompress $1 ;;
+ *.7z) 7z x $1 ;;
+ *.xz) unxz $1 ;;
+ *.exe) cabextract $1 ;;
+ *.ace) unace $1 ;;
+ *.arj) unarj $1 ;;
+ *) echo "\`$1': unknown archive" ;;
+ esac
+ else
+ echo "\`$1' unknown file"
+ fi
+}