Made a lot of changes: no more functions directory. All aliases have been moved to...
authorRobert R Evans <robert@codewranglers.org>
Sun, 10 Oct 2010 16:24:19 +0000 (09:24 -0700)
committerRobert R Evans <robert@codewranglers.org>
Sun, 10 Oct 2010 16:24:19 +0000 (09:24 -0700)
21 files changed:
.gitignore
README.md
aliases/emacs.aliases.bash [new file with mode: 0644]
aliases/general.aliases.bash [moved from lib/aliases.bash with 100% similarity]
aliases/git.aliases.bash [moved from plugins/git.plugin.bash with 100% similarity]
aliases/heroku.aliases.bash [moved from plugins/heroku.plugin.bash with 100% similarity]
aliases/osx.aliases.bash [new file with mode: 0644]
aliases/rails.aliases.bash [moved from plugins/rails.plugin.bash with 100% similarity]
aliases/textmate.aliases.bash [moved from plugins/textmate.plugin.bash with 100% similarity]
aliases/vim.aliases.bash [new file with mode: 0644]
bash_it.sh
functions/base.funtions.bash [deleted file]
lib/history.bash
plugins/base.plugin.bash
plugins/emacs.plugin.bash [deleted file]
plugins/git.plugins.bash [moved from functions/git.functions.bash with 100% similarity]
plugins/hg.plugins.bash [new file with mode: 0644]
plugins/javascript.plugins.bash [moved from functions/javascript.functions.bash with 100% similarity]
plugins/nginx.plugins.bash [moved from functions/nginx.functions.bash with 100% similarity]
plugins/osx.plugin.bash
plugins/vim.plugin.bash [deleted file]

index b9003bb..bcddac3 100644 (file)
@@ -1,4 +1,7 @@
 .DS_Store
 custom/*.bash
 !custom/example.bash
-.rvmrc
\ No newline at end of file
+.rvmrc
+aliases/custom.aliases.bash
+lib/custom.bash
+plugins/custom.plugins.bash
\ No newline at end of file
index 2985cbf..9578c43 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,11 +2,6 @@
 
 'Bash it' is a mash up of my own bash commands and scripts, other bash stuff I have found and a shameless ripoff of oh-my-zsh. :) 
 
-From what I remember, I've incorporated things I have found from the following:
-
-* oh-my-zsh   (http://github.com/robbyrussell/oh-my-zsh)
-* Steve Losh  (http://stevelosh.com/)
-
 Includes some autocompletion tools, theming support, aliases, custom functions, and more. 
 
 ## Install
@@ -21,7 +16,7 @@ cp <path/to/cloned/repo>/template/bash_profile.template.bash ~/.bash_profile
 
 </code></pre>
 
-I'm working on adding various custom help screens to bash it. Currently, bash it has the following commands to show help screens:
+## Help Screens
 
 <pre><code>
 bash-it (will show all the help commands)
@@ -32,12 +27,30 @@ git-help
 
 ## Your Custom scripts, aliases, and functions
 
-If you have custom stuff that you don't want committed to bash it, put those scripts into the custom directory. It is automatically ignored by git.
+For custom scripts, and aliases, you can create the following files and they will be ignored by the git repo:
+
+* aliases/custom.aliases.bash
+* lib/custom.bash
+* plugins/custom.plugins.bash
+
+and anything in the custom directory will be ignored with the exception of custom/example.bash. 
 
 ## Themes
 
-Currently, there is only 1 theme, 'bobby'. There is a base.theme.bash that includes various colors that can then be used to create custom themes. There is support for git in the prompt: showing what branch you're on, if you've committed locally or not, etc. I'm working on adding mercurial support as well.
+There are a few bash-it themes, but I'm hoping the community will jump in and create their own custom prompts and share their creations with everyone else by submitting a pull request to me (revans).
+
+## Help out
+
+I think all of us have our own custom scripts that we have added over time and so following in the footsteps of oh-my-zsh, bash-it was created as a framework for those who choose to use bash as their shell. As a community, I'm excited to see what everyone else has in their custom toolbox and am hoping that they'll share it with everyone by submitting a pull request to bash-it.
+
+So, if you have contributions to bash-it, please send me a pull request and I'll take a look at it and commit it to the repo as long as it looks good. If you do change an existing command, please give an explanation as to why. That will help a lot when I merge your changes in. Thanks, and happing bashing!
+
+
+## Contributors
 
-## Help out!
+If you are submitting a pull request, please add your name to the list.
 
-Just like oh-my-zsh, 'bash it' is meant for the community. If you have things to add, want to add a theme, etc. please fork this project and send me a pull request.
\ No newline at end of file
+* Robert Evans
+* David Bradford
+* Rich Manalang
+* Piotr Usewicz
\ No newline at end of file
diff --git a/aliases/emacs.aliases.bash b/aliases/emacs.aliases.bash
new file mode 100644 (file)
index 0000000..792d737
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+alias em="emacs"
\ No newline at end of file
diff --git a/aliases/osx.aliases.bash b/aliases/osx.aliases.bash
new file mode 100644 (file)
index 0000000..8d6b2d8
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Desktop Programs
+alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
+alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
+alias preview="open -a '$PREVIEW'"
+alias xcode="open -a '/Developer/Applications/Xcode.app'"
+alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
+alias safari="open -a safari"
+alias firefox="open -a firefox"
+alias dashcode="open -a dashcode"
+alias f='open -a Finder '
+
+if [ -s /usr/bin/firefox ] ; then
+  unalias firefox
+fi
+
diff --git a/aliases/vim.aliases.bash b/aliases/vim.aliases.bash
new file mode 100644 (file)
index 0000000..d102575
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+alias v='mvim --remote-tab'
\ No newline at end of file
index b588059..c13b309 100644 (file)
@@ -27,7 +27,6 @@ do
   source $config_file
 done
 
-unset config_file
 # Plugins
 PLUGINS="${BASH}/plugins/*.bash"
 for config_file in $PLUGINS
@@ -35,8 +34,8 @@ do
   source $config_file
 done
 
-# Functions
-FUNCTIONS="${BASH}/functions/*.bash"
+# Aliases
+FUNCTIONS="${BASH}/aliases/*.bash"
 for config_file in $FUNCTIONS
 do
   source $config_file
@@ -49,6 +48,8 @@ do
   source $config_file
 done
 
+
+unset config_file
 export PS1=$PROMPT
 
 
diff --git a/functions/base.funtions.bash b/functions/base.funtions.bash
deleted file mode 100644 (file)
index d1f467d..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-
-function ips {
-  ifconfig | grep "inet " | awk '{ print $2 }'
-}
-
-function myip {
-  res=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+')
-  echo "Your public IP is: ${bold_green} $res ${normal}"
-}
-
-
-# View man documentation in Preview
-pman () {
-   man -t "${1}" | open -f -a $PREVIEW
-}
-
-
-pcurl() {
-  curl "${1}" | open -f -a $PREVIEW
-}
-
-pri() {
-  ri -T "${1}" | open -f -a $PREVIEW
-}
-
-
-# disk usage per directory
-usage ()
-{
-  if [ $1 ]
-  then
-    du -hd $1
-  else
-    du -hd 1
-  fi
-}
\ No newline at end of file
index c7dcaa6..c0f60f2 100644 (file)
@@ -13,7 +13,6 @@ export HISTCONTROL=erasedups
 # resize history size
 export HISTSIZE=5000
 
-
 export AUTOFEATURE=true autotest
 
 function rh {
index 4984df8..931bb41 100644 (file)
@@ -1,16 +1,39 @@
 #!/bin/bash
 
-# Desktop Programs
-alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
-alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
-alias preview="open -a '$PREVIEW'"
-alias xcode="open -a '/Developer/Applications/Xcode.app'"
-alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
-alias safari="open -a safari"
-alias firefox="open -a firefox"
-alias dashcode="open -a dashcode"
-
-
-if [ -s /usr/bin/firefox ] ; then
-  unalias firefox
-fi
\ No newline at end of file
+# For generic functions.
+
+function ips {
+  ifconfig | grep "inet " | awk '{ print $2 }'
+}
+
+function myip {
+  res=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+')
+  echo "Your public IP is: ${bold_green} $res ${normal}"
+}
+
+
+# View man documentation in Preview
+pman () {
+   man -t "${1}" | open -f -a $PREVIEW
+}
+
+
+pcurl() {
+  curl "${1}" | open -f -a $PREVIEW
+}
+
+pri() {
+  ri -T "${1}" | open -f -a $PREVIEW
+}
+
+
+# disk usage per directory
+usage ()
+{
+  if [ $1 ]
+  then
+    du -hd $1
+  else
+    du -hd 1
+  fi
+}
\ No newline at end of file
diff --git a/plugins/emacs.plugin.bash b/plugins/emacs.plugin.bash
deleted file mode 100644 (file)
index fc9d0bf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-alias em="emacs"
\ No newline at end of file
diff --git a/plugins/hg.plugins.bash b/plugins/hg.plugins.bash
new file mode 100644 (file)
index 0000000..f72761b
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+hg_dirty() {
+    hg status --no-color 2> /dev/null \
+    | awk '$1 == "?" { print "?" } $1 != "?" { print "!" }' \
+    | sort | uniq | head -c1
+}
+
+hg_in_repo() {
+    [[ `hg branch 2> /dev/null` ]] && echo 'on '
+}
+
+hg_branch() {
+    hg branch 2> /dev/null
+}
\ No newline at end of file
index 1dd9266..c366b3f 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-alias f='open -a Finder '
-
 function tab() {
   osascript 2>/dev/null <<EOF
     tell application "System Events"
diff --git a/plugins/vim.plugin.bash b/plugins/vim.plugin.bash
deleted file mode 100644 (file)
index dc224a9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-alias v='mvim --remote-tab'
-