blob: 64a952322d7a8e829f5556bf3a006f53fb170902 [file] [log] [blame]
Robert R Evans76ed68d2010-10-02 12:29:17 -07001#!/bin/bash
Robert R Evans9c7cd9a2010-10-02 11:55:34 -07002# Initialize Bash It
3
4# Reload Library
5alias reload='source ~/.bash_profile'
6
John Schulze3194232011-10-28 19:22:20 -04007# Only set $BASH_IT if it's not already set
8[ -z "$BASH_IT" ] && export BASH_IT=$HOME/.bash_it
9
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050010# Load enabled aliases, completion, plugins
11for file_type in "aliases" "completion" "plugins"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070012do
John Schulz323ce202011-09-20 11:07:48 -040013 if [ ! -d "${BASH_IT}/${file_type}/enabled" ]
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050014 then
John Schulz323ce202011-09-20 11:07:48 -040015 continue
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050016 fi
John Schulz323ce202011-09-20 11:07:48 -040017 FILES="${BASH_IT}/${file_type}/enabled/*.bash"
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050018 for config_file in $FILES
19 do
20 source $config_file
21 done
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070022done
23
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050024# Load any custom aliases that the user has added
John Schulz323ce202011-09-20 11:07:48 -040025if [ -e "${BASH_IT}/aliases/custom.aliases.bash" ]
Mark Szymanski78270b32011-06-17 11:22:39 -050026then
John Schulz323ce202011-09-20 11:07:48 -040027 source "${BASH_IT}/aliases/custom.aliases.bash"
Mark Szymanski78270b32011-06-17 11:22:39 -050028fi
Mark Szymanski50179fd2011-06-13 22:05:45 -050029
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070030# Custom
John Schulz323ce202011-09-20 11:07:48 -040031CUSTOM="${BASH_IT}/custom/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070032for config_file in $CUSTOM
33do
34 source $config_file
Robert R Evansa7d1ee02010-10-02 15:04:24 -070035done
36
John Schulz7483c6d2011-10-27 19:29:34 -040037# Load colors first so they can be use in base theme
38source "${BASH_IT}/themes/colors.theme.bash"
39source "${BASH_IT}/themes/base.theme.bash"
40
41# library
John Schulz7483c6d2011-10-27 19:29:34 -040042LIB="${BASH_IT}/lib/*.bash"
43for config_file in $LIB
44do
45 source $config_file
46done
Robert R Evans2010f012010-10-10 09:24:19 -070047
48unset config_file
John Schulz6e7f4232010-11-11 11:57:47 -050049if [[ $PROMPT ]]; then
50 export PS1=$PROMPT
51fi
Robert R Evansc9da0862010-10-06 17:27:55 -070052
53# Adding Support for other OSes
54PREVIEW="less"
55[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
56[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"
57
Mark Szymanski9ad79642011-06-24 17:49:19 -050058# Load all the Jekyll stuff
59
60if [ -e $HOME/.jekyllconfig ]
61then
62 . $HOME/.jekyllconfig
63fi
64
Robert R Evansc9da0862010-10-06 17:27:55 -070065
Robert R Evansa7d1ee02010-10-02 15:04:24 -070066#
67# Custom Help
68
69function bash-it() {
70 echo "Welcome to Bash It!"
71 echo
72 echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:"
73 echo
74 echo " rails-help This will list out all the aliases you can use with rails."
75 echo " git-help This will list out all the aliases you can use with git."
Mark Szymanskie6fb7032010-10-31 15:32:22 -050076 echo " todo-help This will list out all the aliases you can use with todo.txt-cli"
Mark Szymanskib7a0cb62011-06-05 20:45:53 -050077 echo " brew-help This will list out all the aliases you can use with Homebrew"
Robert R Evans5e0e86f2010-10-02 15:29:23 -070078 echo " aliases-help Generic list of aliases."
Florian Baumannbd224852010-11-08 21:52:49 +010079 echo " plugins-help This will list out all the plugins and functions you can use with bash-it"
Robert R Evansa7d1ee02010-10-02 15:04:24 -070080 echo
Mark Szymanskie6fb7032010-10-31 15:32:22 -050081}