Browse Source

Add .bashrc

sdbarker 6 years ago
parent
commit
4ed3baa1c5
3 changed files with 1602 additions and 1 deletions
  1. 85 0
      bash/.bashrc
  2. 1500 0
      bash/git-completion.bash
  3. 17 1
      install.sh

+ 85 - 0
bash/.bashrc

@@ -0,0 +1,85 @@
+# .bashrc
+
+# User specific aliases and functions
+
+# Source global definitions
+if [ -f /etc/bashrc ]; then
+	. /etc/bashrc
+fi
+
+set -o vi
+
+# Git autocomplete
+source git-completion.bash
+
+# Override existing commands
+alias ls='ls -alh --color=always'
+
+alias ..='cd ..'
+
+# Misc.
+alias x='exit'
+
+# CVS
+# alias crm='cvs rm -f $1'
+# alias ccm='cvs commit -m "$1"'
+
+# Screen aliases
+# alias sl='screen -ls'
+# alias sx='screen -x $1'
+# alias sr='screen -Rd $1'
+# alias ss='screen -S $1'
+# alias sc='clear; screen'
+# alias sn='clear; screen'
+
+# Utilities
+# export CVSROOT=/cvsroot
+export GREP_COLOR='1;35'
+alias grep='grep --color=auto'
+
+function set_prompt {
+	local blue="\[\033[1;34m\]"
+	local gray="\[\033[0;37m\]"
+	local green="\[\033[1;32m\]"
+	export PS1="[$blue\d @ \@$gray]\n$gray[\[email protected]\h$green:\w$gray"'$(__git_ps1 "][%s")'"] "
+}
+
+set_prompt
+
+bind TAB:menu-complete
+
+# function cvsradd {
+# 	find * -name CVS -prune -o -type f -print | xargs cvs add
+# 	find * -type d -print | xargs cvs add
+# }
+
+function gtar {
+	if [ $# != 0 ]
+	then
+		if [ $1 = "-nodate" ]
+		then
+			shift
+			FILE=$1
+		else
+			DATE=$(date "+%Y%m%d")
+			FILE=$1_${DATE}
+		fi
+
+		shift
+		tar -cvf ${FILE}.tar $*
+		gzip ${FILE}.tar
+	else
+		echo "Usage: gtar [-nodate] filename file1 [file2 file3 ...]"
+		echo ""
+		echo "Creates a gzip'd tarball called filename[_DATE].tar.gz containing"
+		echo "file1..fileN.  The -nodate switch will remove the _DATE from the"
+		echo "filename if specified."
+	fi
+}
+
+export PATH=$PATH:/usr/local/bin/:/usr/local/arm-elf/bin
+
+export GIT_AUTHOR_NAME="sdbarker"
+export GIT_AUTHOR_EMAIL="[email protected]r.com"
+export GIT_COMMITTER_NAME="sdbarker"
+export GIT_COMMITTER_EMAIL="[email protected]"

File diff suppressed because it is too large
+ 1500 - 0
bash/git-completion.bash


+ 17 - 1
install.sh

@@ -5,9 +5,19 @@ SEP="---------------------------"
 echo $TITLE
 echo $SEP
 
+install_bashrc ()
+{
+	echo "Installing .bashrc"
+	cp ./bash/.bashrc ~
+	cp ./bash/git-completion.bash ~
+	echo "Done."
+	echo
+}
+
 install_vimrc ()
 {
 	echo "Installing .vimrc..."
+	mkdir ~/.vim
 	cp ./vimrc/_vimrc ~/.vimrc
 	cp --recursive ./vimrc/vimfiles/* ~/.vim
 	echo "Done."
@@ -17,11 +27,17 @@ install_vimrc ()
 install_gitconfig ()
 {
 	echo "Installing .gitconfig..."
-	cp --recursive ./gitconfig/* ~
+	cp ./gitconfig/.gitconfig ~
+	cp ./gitconfig/.gitignore ~
 	echo "Done."
 	echo
 }
 
+read -p "Install .bashrc (y/n)? "
+if [ "$REPLY" == "y" ]; then
+	install_bashrc
+fi
+
 read -p "Install .vimrc (y/n)? "
 if [ "$REPLY" == "y" ]; then
 	install_vimrc