blob: b3cdb737bc9b2922afad57de1189af7e4acf3e95 [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
20# Tab Completion
21COMPLETION="${BASH}/completion/*.bash"
22for config_file in $COMPLETION
23do
24 source $config_file
25done
26
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070027# Plugins
Mark Szymanski1b268e72011-05-27 11:53:54 -050028if [ ! -d "plugins/enabled" ]
29then
30 mkdir "${BASH}/plugins/enabled"
31 ln -s ${BASH}/plugins/available/* "${BASH}/plugins/enabled"
32fi
Travis Swicegoodffa45b02011-05-02 23:05:59 -050033PLUGINS="${BASH}/plugins/enabled/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070034for config_file in $PLUGINS
35do
36 source $config_file
37done
38
Robert R Evans2010f012010-10-10 09:24:19 -070039# Aliases
40FUNCTIONS="${BASH}/aliases/*.bash"
Robert R Evans9c7cd9a2010-10-02 11:55:34 -070041for config_file in $FUNCTIONS
42do
43 source $config_file
44done
45
46# Custom
47CUSTOM="${BASH}/custom/*.bash"
48for config_file in $CUSTOM
49do
50 source $config_file
Robert R Evansa7d1ee02010-10-02 15:04:24 -070051done
52
Robert R Evans2010f012010-10-10 09:24:19 -070053
54unset config_file
John Schulz6e7f4232010-11-11 11:57:47 -050055if [[ $PROMPT ]]; then
56 export PS1=$PROMPT
57fi
Robert R Evansc9da0862010-10-06 17:27:55 -070058
59# Adding Support for other OSes
60PREVIEW="less"
61[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview"
62[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app"
63
64
Robert R Evansa7d1ee02010-10-02 15:04:24 -070065#
66# Custom Help
67
68function bash-it() {
69 echo "Welcome to Bash It!"
70 echo
71 echo "Here is a list of commands you can use to get help screens for specific pieces of Bash it:"
72 echo
73 echo " rails-help This will list out all the aliases you can use with rails."
74 echo " git-help This will list out all the aliases you can use with git."
Mark Szymanskie6fb7032010-10-31 15:32:22 -050075 echo " todo-help This will list out all the aliases you can use with todo.txt-cli"
Robert R Evans5e0e86f2010-10-02 15:29:23 -070076 echo " aliases-help Generic list of aliases."
Florian Baumannbd224852010-11-08 21:52:49 +010077 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 -070078 echo
Mark Szymanskie6fb7032010-10-31 15:32:22 -050079}