]> git.rmz.io Git - dotfiles.git/blobdiff - bashrc
add bashrc stuff
[dotfiles.git] / bashrc
diff --git a/bashrc b/bashrc
new file mode 100644 (file)
index 0000000..cf52ff5
--- /dev/null
+++ b/bashrc
@@ -0,0 +1,74 @@
+if [ -f /etc/bash_completion ]; then
+    . /etc/bash_completion
+fi
+
+xhost +local:root > /dev/null 2>&1
+
+shopt -s cdspell
+shopt -s checkwinsize
+shopt -s cmdhist
+shopt -s dotglob
+shopt -s expand_aliases
+shopt -s extglob
+shopt -s histappend
+shopt -s hostcomplete
+# shopt -s nocaseglob # never! lost a file cause of this shit
+
+export HISTSIZE=10000
+export HISTFILESIZE=${HISTSIZE}
+export HISTCONTROL=ignoreboth
+
+# ex - archive extractor
+# usage: ex <file>
+ex ()
+{
+    if [ -f $1 ] ; then
+        case $1 in
+            *.tar.bz2)  tar xjf $1      ;;
+            *.tar.gz)   tar xzf $1      ;;
+            *.tar.xz)   tar -x --xz -f $1 ;;
+            *.bz2)      bunzip2 $1      ;;
+            *.rar)      unrar x $1      ;;
+            *.gz)       gunzip $1       ;;
+            *.tar)      tar xf $1       ;;
+            *.tbz2)     tar xjf $1      ;;
+            *.tgz)      tar xzf $1      ;;
+            *.zip)      unzip $1        ;;
+            *.Z)        uncompress $1   ;;
+            *.7z)       7z x $1         ;;
+            *)           echo "'$1' cannot be extracted via ex()" ;;
+        esac
+    else
+        echo "'$1' is not a valid file"
+    fi
+}
+
+# vim stuff
+export EDITOR=vim
+export VISUAL=vim
+
+# prompt
+prompt ()
+{
+    . ~/.bash_colors
+    PS1="[\u@\[${bldred}\]\h\[${bldblu}\] \W\[${txtrst}\]]\[${txtrst}\]\$ "
+}
+prompt
+unset prompt
+
+# Stuff from ubuntu
+# make less more friendly for non-text input files, see lesspipe(1)
+[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+
+# Alias definitions.
+# You may want to put all your additions into a separate file like
+# ~/.bash_aliases, instead of adding them here directly.
+# See /usr/share/doc/bash-doc/examples in the bash-doc package.
+if [ -f ~/.bash_aliases ]; then
+    . ~/.bash_aliases
+fi
+
+# set PATH so it includes user's private bin if it exists
+if [ -d "$HOME/bin" ] ; then
+    PATH="$HOME/bin:$PATH"
+fi