blob: 66363f913211b860afbea319fa2e55e9711495db [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
Travis Swicegoodb59ee652011-10-29 18:56:36 -05008if [ -z "$BASH_IT" ];
9then
10 # Setting $BASH to maintain backwards compatibility
11 # TODO: warn users that they should upgrade their .bash_profile
12 export BASH_IT=$BASH
13 export BASH=`bash -c 'echo $BASH'`
14fi
15
16# For backwards compatibility, look in old BASH_THEME location
17if [ -z "$BASH_IT_THEME" ];
18then
19 # TODO: warn users that they should upgrade their .bash_profile
20 export BASH_IT_THEME="$BASH_THEME";
21 unset $BASH_THEME;
22fi
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070023
Travis Swicegoodb6d444d2011-10-29 18:55:20 -050024# Load colors first so they can be use in base theme
25source "${BASH_IT}/themes/colors.theme.bash"
26source "${BASH_IT}/themes/base.theme.bash"
27
28# library
29LIB="${BASH_IT}/lib/*.bash"
30for config_file in $LIB
31do
32 source $config_file
33done
34
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050035# Load enabled aliases, completion, plugins
36for file_type in "aliases" "completion" "plugins"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070037do
Travis Swicegoodb524bb62012-03-26 11:19:38 -050038 _load_bash_it_files $file_type
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070039done
40
Travis Swicegoodd7cfa8b2011-06-21 09:31:26 -050041# Load any custom aliases that the user has added
John Schulz323ce202011-09-20 11:07:48 -040042if [ -e "${BASH_IT}/aliases/custom.aliases.bash" ]
Mark Szymanski78270b32011-06-17 11:22:39 -050043then
John Schulz323ce202011-09-20 11:07:48 -040044 source "${BASH_IT}/aliases/custom.aliases.bash"
Mark Szymanski78270b32011-06-17 11:22:39 -050045fi
Mark Szymanski50179fd2011-06-13 22:05:45 -050046
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070047# Custom
John Schulz323ce202011-09-20 11:07:48 -040048CUSTOM="${BASH_IT}/custom/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070049for config_file in $CUSTOM
50do
Jon Schewe7d18ccc2011-10-09 20:44:29 -050051 if [ -e "${config_file}" ]; then
52 source $config_file
53 fi
Robert R Evansa7d1ee02010-10-02 15:04:24 -070054done
55
Robert R Evans2010f012010-10-10 09:24:19 -070056unset config_file
John Schulz6e7f4232010-11-11 11:57:47 -050057if [[ $PROMPT ]]; then
58 export PS1=$PROMPT
59fi
Robert R Evansc9da0862010-10-06 17:27:55 -070060
61# Adding Support for other OSes
62PREVIEW="less"
63[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
64[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"
65
Mark Szymanski9ad79642011-06-24 17:49:19 -050066# Load all the Jekyll stuff
67
68if [ -e $HOME/.jekyllconfig ]
69then
70 . $HOME/.jekyllconfig
71fi
72
Robert R Evansc9da0862010-10-06 17:27:55 -070073
Robert R Evansa7d1ee02010-10-02 15:04:24 -070074#
75# Custom Help
76
77function bash-it() {
78 echo "Welcome to Bash It!"
79 echo
80 echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:"
81 echo
82 echo " rails-help This will list out all the aliases you can use with rails."
83 echo " git-help This will list out all the aliases you can use with git."
Mark Szymanskie6fb7032010-10-31 15:32:22 -050084 echo " todo-help This will list out all the aliases you can use with todo.txt-cli"
Mark Szymanskib7a0cb62011-06-05 20:45:53 -050085 echo " brew-help This will list out all the aliases you can use with Homebrew"
Robert R Evans5e0e86f2010-10-02 15:29:23 -070086 echo " aliases-help Generic list of aliases."
Florian Baumannbd224852010-11-08 21:52:49 +010087 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 -070088 echo
Mark Szymanskie6fb7032010-10-31 15:32:22 -050089}