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 |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 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 |
Jon Schewe | 7d18ccc | 2011-10-09 20:44:29 -0500 | [diff] [blame] | 20 | if [ -e "${config_file}" ]; then |
| 21 | source $config_file |
| 22 | fi |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 23 | done |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 24 | done |
| 25 | |
Travis Swicegood | d7cfa8b | 2011-06-21 09:31:26 -0500 | [diff] [blame] | 26 | # Load any custom aliases that the user has added |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 27 | if [ -e "${BASH_IT}/aliases/custom.aliases.bash" ] |
Mark Szymanski | 78270b3 | 2011-06-17 11:22:39 -0500 | [diff] [blame] | 28 | then |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 29 | source "${BASH_IT}/aliases/custom.aliases.bash" |
Mark Szymanski | 78270b3 | 2011-06-17 11:22:39 -0500 | [diff] [blame] | 30 | fi |
Mark Szymanski | 50179fd | 2011-06-13 22:05:45 -0500 | [diff] [blame] | 31 | |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 32 | # Custom |
John Schulz | 323ce20 | 2011-09-20 11:07:48 -0400 | [diff] [blame] | 33 | CUSTOM="${BASH_IT}/custom/*.bash" |
Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 34 | for config_file in $CUSTOM |
| 35 | do |
Jon Schewe | 7d18ccc | 2011-10-09 20:44:29 -0500 | [diff] [blame] | 36 | if [ -e "${config_file}" ]; then |
| 37 | source $config_file |
| 38 | fi |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 39 | done |
| 40 | |
John Schulz | 7483c6d | 2011-10-27 19:29:34 -0400 | [diff] [blame] | 41 | # Load colors first so they can be use in base theme |
| 42 | source "${BASH_IT}/themes/colors.theme.bash" |
| 43 | source "${BASH_IT}/themes/base.theme.bash" |
| 44 | |
| 45 | # library |
John Schulz | 7483c6d | 2011-10-27 19:29:34 -0400 | [diff] [blame] | 46 | LIB="${BASH_IT}/lib/*.bash" |
| 47 | for config_file in $LIB |
| 48 | do |
| 49 | source $config_file |
| 50 | done |
Robert R Evans | 2010f01 | 2010-10-10 09:24:19 -0700 | [diff] [blame] | 51 | |
| 52 | unset config_file |
John Schulz | 6e7f423 | 2010-11-11 11:57:47 -0500 | [diff] [blame] | 53 | if [[ $PROMPT ]]; then |
| 54 | export PS1=$PROMPT |
| 55 | fi |
Robert R Evans | c9da086 | 2010-10-06 17:27:55 -0700 | [diff] [blame] | 56 | |
| 57 | # Adding Support for other OSes |
| 58 | PREVIEW="less" |
| 59 | [ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" |
| 60 | [ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" |
| 61 | |
Mark Szymanski | 9ad7964 | 2011-06-24 17:49:19 -0500 | [diff] [blame] | 62 | # Load all the Jekyll stuff |
| 63 | |
| 64 | if [ -e $HOME/.jekyllconfig ] |
| 65 | then |
| 66 | . $HOME/.jekyllconfig |
| 67 | fi |
| 68 | |
Robert R Evans | c9da086 | 2010-10-06 17:27:55 -0700 | [diff] [blame] | 69 | |
Robert R Evans | a7d1ee0 | 2010-10-02 15:04:24 -0700 | [diff] [blame] | 70 | # |
| 71 | # Custom Help |
| 72 | |
| 73 | function bash-it() { |
| 74 | echo "Welcome to Bash It!" |
| 75 | echo |
| 76 | echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:" |
| 77 | echo |
| 78 | echo " rails-help This will list out all the aliases you can use with rails." |
| 79 | 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] | 80 | 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] | 81 | 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] | 82 | echo " aliases-help Generic list of aliases." |
Florian Baumann | bd22485 | 2010-11-08 21:52:49 +0100 | [diff] [blame] | 83 | 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] | 84 | echo |
Mark Szymanski | e6fb703 | 2010-10-31 15:32:22 -0500 | [diff] [blame] | 85 | } |