Robert R Evans | 76ed68d | 2010-10-02 12:29:17 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 2 | # Initialize Bash It |
| 3 | |
| 4 | # Reload Library |
| 5 | alias reload='source ~/.bash_profile' |
| 6 | |
John Schulz | e319423 | 2011-10-28 19:22:20 -0400 | [diff] [blame^] | 7 | # Only set $BASH_IT if it's not already set |
| 8 | [ -z "$BASH_IT" ] && export BASH_IT=$HOME/.bash_it |
| 9 | |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 10 | # Load enabled aliases, completion, plugins |
| 11 | for file_type in "aliases" "completion" "plugins" |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 12 | do |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 13 | if [ ! -d "${BASH_IT}/${file_type}/enabled" ] |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 14 | then |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 15 | continue |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 16 | fi |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 17 | FILES="${BASH_IT}/${file_type}/enabled/*.bash" |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 18 | for config_file in $FILES |
| 19 | do |
| 20 | source $config_file |
| 21 | done |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 22 | done |
| 23 | |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 24 | # Load any custom aliases that the user has added |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 25 | if [ -e "${BASH_IT}/aliases/custom.aliases.bash" ] |
Mark Szymanski | 78270b3 | 2011-06-17 11:22:39 -0500 | [diff] [blame] | 26 | then |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 27 | source "${BASH_IT}/aliases/custom.aliases.bash" |
Mark Szymanski | 78270b3 | 2011-06-17 11:22:39 -0500 | [diff] [blame] | 28 | fi |
Mark Szymanski | 50179fd | 2011-06-13 22:05:45 -0500 | [diff] [blame] | 29 | |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 30 | # Custom |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 31 | CUSTOM="${BASH_IT}/custom/*.bash" |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 32 | for config_file in $CUSTOM |
| 33 | do |
| 34 | source $config_file |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 35 | done |
| 36 | |
John Schulz | 7483c6d | 2011-10-27 19:29:34 -0400 | [diff] [blame] | 37 | # Load colors first so they can be use in base theme |
| 38 | source "${BASH_IT}/themes/colors.theme.bash" |
| 39 | source "${BASH_IT}/themes/base.theme.bash" |
| 40 | |
| 41 | # library |
John Schulz | 7483c6d | 2011-10-27 19:29:34 -0400 | [diff] [blame] | 42 | LIB="${BASH_IT}/lib/*.bash" |
| 43 | for config_file in $LIB |
| 44 | do |
| 45 | source $config_file |
| 46 | done |
Robert R Evans | 2010f01 | 2010-10-10 09:24:19 -0700 | [diff] [blame] | 47 | |
| 48 | unset config_file |
John Schulz | 6e7f423 | 2010-11-11 11:57:47 -0500 | [diff] [blame] | 49 | if [[ $PROMPT ]]; then |
| 50 | export PS1=$PROMPT |
| 51 | fi |
Robert R Evans | c9da086 | 2010-10-06 17:27:55 -0700 | [diff] [blame] | 52 | |
| 53 | # Adding Support for other OSes |
| 54 | PREVIEW="less" |
| 55 | [ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" |
| 56 | [ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" |
| 57 | |
Mark Szymanski | 9ad7964 | 2011-06-24 17:49:19 -0500 | [diff] [blame] | 58 | # Load all the Jekyll stuff |
| 59 | |
| 60 | if [ -e $HOME/.jekyllconfig ] |
| 61 | then |
| 62 | . $HOME/.jekyllconfig |
| 63 | fi |
| 64 | |
Robert R Evans | c9da086 | 2010-10-06 17:27:55 -0700 | [diff] [blame] | 65 | |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 66 | # |
| 67 | # Custom Help |
| 68 | |
| 69 | function 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 Szymanski | e6fb703 | 2010-10-31 15:32:22 -0500 | [diff] [blame] | 76 | echo " todo-help This will list out all the aliases you can use with todo.txt-cli" |
Mark Szymanski | b7a0cb6 | 2011-06-05 20:45:53 -0500 | [diff] [blame] | 77 | echo " brew-help This will list out all the aliases you can use with Homebrew" |
Robert R Evans | 5e0e86f | 2010-10-02 15:29:23 -0700 | [diff] [blame] | 78 | echo " aliases-help Generic list of aliases." |
Florian Baumann | bd22485 | 2010-11-08 21:52:49 +0100 | [diff] [blame] | 79 | echo " plugins-help This will list out all the plugins and functions you can use with bash-it" |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 80 | echo |
Mark Szymanski | e6fb703 | 2010-10-31 15:32:22 -0500 | [diff] [blame] | 81 | } |