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 View File

@@ -0,0 +1,85 @@
1
+# .bashrc
2
+
3
+# User specific aliases and functions
4
+
5
+# Source global definitions
6
+if [ -f /etc/bashrc ]; then
7
+	. /etc/bashrc
8
+fi
9
+
10
+set -o vi
11
+
12
+# Git autocomplete
13
+source git-completion.bash
14
+
15
+# Override existing commands
16
+alias ls='ls -alh --color=always'
17
+
18
+alias ..='cd ..'
19
+
20
+# Misc.
21
+alias x='exit'
22
+
23
+# CVS
24
+# alias crm='cvs rm -f $1'
25
+# alias ccm='cvs commit -m "$1"'
26
+
27
+# Screen aliases
28
+# alias sl='screen -ls'
29
+# alias sx='screen -x $1'
30
+# alias sr='screen -Rd $1'
31
+# alias ss='screen -S $1'
32
+# alias sc='clear; screen'
33
+# alias sn='clear; screen'
34
+
35
+# Utilities
36
+# export CVSROOT=/cvsroot
37
+export GREP_COLOR='1;35'
38
+alias grep='grep --color=auto'
39
+
40
+function set_prompt {
41
+	local blue="\[\033[1;34m\]"
42
+	local gray="\[\033[0;37m\]"
43
+	local green="\[\033[1;32m\]"
44
+	export PS1="[$blue\d @ \@$gray]\n$gray[\u@\h$green:\w$gray"'$(__git_ps1 "][%s")'"] "
45
+}
46
+
47
+set_prompt
48
+
49
+bind TAB:menu-complete
50
+
51
+# function cvsradd {
52
+# 	find * -name CVS -prune -o -type f -print | xargs cvs add
53
+# 	find * -type d -print | xargs cvs add
54
+# }
55
+
56
+function gtar {
57
+	if [ $# != 0 ]
58
+	then
59
+		if [ $1 = "-nodate" ]
60
+		then
61
+			shift
62
+			FILE=$1
63
+		else
64
+			DATE=$(date "+%Y%m%d")
65
+			FILE=$1_${DATE}
66
+		fi
67
+
68
+		shift
69
+		tar -cvf ${FILE}.tar $*
70
+		gzip ${FILE}.tar
71
+	else
72
+		echo "Usage: gtar [-nodate] filename file1 [file2 file3 ...]"
73
+		echo ""
74
+		echo "Creates a gzip'd tarball called filename[_DATE].tar.gz containing"
75
+		echo "file1..fileN.  The -nodate switch will remove the _DATE from the"
76
+		echo "filename if specified."
77
+	fi
78
+}
79
+
80
+export PATH=$PATH:/usr/local/bin/:/usr/local/arm-elf/bin
81
+
82
+export GIT_AUTHOR_NAME="sdbarker"
83
+export GIT_AUTHOR_EMAIL="scott@sdbarker.com"
84
+export GIT_COMMITTER_NAME="sdbarker"
85
+export GIT_COMMITTER_EMAIL="scott@sdbarker.com"

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


+ 17
- 1
install.sh View File

@@ -5,9 +5,19 @@ SEP="---------------------------"
5 5
 echo $TITLE
6 6
 echo $SEP
7 7
 
8
+install_bashrc ()
9
+{
10
+	echo "Installing .bashrc"
11
+	cp ./bash/.bashrc ~
12
+	cp ./bash/git-completion.bash ~
13
+	echo "Done."
14
+	echo
15
+}
16
+
8 17
 install_vimrc ()
9 18
 {
10 19
 	echo "Installing .vimrc..."
20
+	mkdir ~/.vim
11 21
 	cp ./vimrc/_vimrc ~/.vimrc
12 22
 	cp --recursive ./vimrc/vimfiles/* ~/.vim
13 23
 	echo "Done."
@@ -17,11 +27,17 @@ install_vimrc ()
17 27
 install_gitconfig ()
18 28
 {
19 29
 	echo "Installing .gitconfig..."
20
-	cp --recursive ./gitconfig/* ~
30
+	cp ./gitconfig/.gitconfig ~
31
+	cp ./gitconfig/.gitignore ~
21 32
 	echo "Done."
22 33
 	echo
23 34
 }
24 35
 
36
+read -p "Install .bashrc (y/n)? "
37
+if [ "$REPLY" == "y" ]; then
38
+	install_bashrc
39
+fi
40
+
25 41
 read -p "Install .vimrc (y/n)? "
26 42
 if [ "$REPLY" == "y" ]; then
27 43
 	install_vimrc

Loading…
Cancel
Save