blob: 68f3884d1b13ed52a7a21a7360474305b257d6bd [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
Robert R Evans79e50292010-10-12 14:14:20 -07007# Load the framework
Robert R Evans9c7cd9a2010-10-02 11:55:34 -07008
John Schulzd5645e72010-11-09 23:21:19 -05009# Load colors first so they can be use in base theme
10source "${BASH}/themes/colors.theme.bash"
11source "${BASH}/themes/base.theme.bash"
Robert R Evans070107a2010-10-02 15:23:57 -070012
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070013# Library
14LIB="${BASH}/lib/*.bash"
15for config_file in $LIB
16do
17 source $config_file
18done
19
Travis Swicegoode115b4c2011-06-21 09:20:40 -050020# TODO: reduce the repetition here by combining these three into a loop
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070021# Tab Completion
Travis Swicegoode115b4c2011-06-21 09:20:40 -050022if [ ! -d "${BASH}/completion/enabled" ]
23then
24 mkdir "${BASH}/completion/enabled"
25 ln -s ${BASH}/completion/available/* "${BASH}/completion/enabled"
26fi
27COMPLETION="${BASH}/completion/enabled/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070028for config_file in $COMPLETION
29do
30 source $config_file
31done
32
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070033# Plugins
Mark Szymanski48148432011-05-27 20:57:57 -050034if [ ! -d "${BASH}/plugins/enabled" ]
Mark Szymanski1b268e72011-05-27 11:53:54 -050035then
36 mkdir "${BASH}/plugins/enabled"
37 ln -s ${BASH}/plugins/available/* "${BASH}/plugins/enabled"
38fi
Travis Swicegoodffa45b02011-05-02 23:05:59 -050039PLUGINS="${BASH}/plugins/enabled/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070040for config_file in $PLUGINS
41do
42 source $config_file
43done
44
Robert R Evans2010f012010-10-10 09:24:19 -070045# Aliases
Travis Swicegoodef420102011-06-12 19:44:27 -050046if [ ! -d "${BASH}/aliases/enabled" ]
47then
48 mkdir "${BASH}/aliases/enabled"
49 ln -s ${BASH}/aliases/available/* "${BASH}/aliases/enabled"
50fi
51FUNCTIONS="${BASH}/aliases/enabled/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070052for config_file in $FUNCTIONS
53do
54 source $config_file
55done
56
Mark Szymanski78270b32011-06-17 11:22:39 -050057if [ -e "${BASH}/aliases/custom.aliases.bash" ]
58then
59 source "${BASH}/aliases/custom.aliases.bash"
60fi
Mark Szymanski50179fd2011-06-13 22:05:45 -050061
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070062# Custom
63CUSTOM="${BASH}/custom/*.bash"
64for config_file in $CUSTOM
65do
66 source $config_file
Robert R Evansa7d1ee02010-10-02 15:04:24 -070067done
68
Robert R Evans2010f012010-10-10 09:24:19 -070069
70unset config_file
John Schulz6e7f4232010-11-11 11:57:47 -050071if [[ $PROMPT ]]; then
72 export PS1=$PROMPT
73fi
Robert R Evansc9da0862010-10-06 17:27:55 -070074
75# Adding Support for other OSes
76PREVIEW="less"
77[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
78[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"
79
80
Robert R Evansa7d1ee02010-10-02 15:04:24 -070081#
82# Custom Help
83
84function bash-it() {
85 echo "Welcome to Bash It!"
86 echo
87 echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:"
88 echo
89 echo " rails-help This will list out all the aliases you can use with rails."
90 echo " git-help This will list out all the aliases you can use with git."
Mark Szymanskie6fb7032010-10-31 15:32:22 -050091 echo " todo-help This will list out all the aliases you can use with todo.txt-cli"
Mark Szymanskib7a0cb62011-06-05 20:45:53 -050092 echo " brew-help This will list out all the aliases you can use with Homebrew"
Robert R Evans5e0e86f2010-10-02 15:29:23 -070093 echo " aliases-help Generic list of aliases."
Florian Baumannbd224852010-11-08 21:52:49 +010094 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 -070095 echo
Mark Szymanskie6fb7032010-10-31 15:32:22 -050096}