Made a lot of changes: no more functions directory. All aliases have been moved to the new alias directory. Plugins are now for functions only. Updated the README to reflect the changes and add a contributor's list.
parent
4f3462b6d1
commit
2010f011f8
|
|
@ -2,3 +2,6 @@
|
||||||
custom/*.bash
|
custom/*.bash
|
||||||
!custom/example.bash
|
!custom/example.bash
|
||||||
.rvmrc
|
.rvmrc
|
||||||
|
aliases/custom.aliases.bash
|
||||||
|
lib/custom.bash
|
||||||
|
plugins/custom.plugins.bash
|
||||||
33
README.md
33
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. :)
|
'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.
|
Includes some autocompletion tools, theming support, aliases, custom functions, and more.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
@ -21,7 +16,7 @@ cp <path/to/cloned/repo>/template/bash_profile.template.bash ~/.bash_profile
|
||||||
|
|
||||||
</code></pre>
|
</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>
|
<pre><code>
|
||||||
bash-it (will show all the help commands)
|
bash-it (will show all the help commands)
|
||||||
|
|
@ -32,12 +27,30 @@ git-help
|
||||||
|
|
||||||
## Your Custom scripts, aliases, and functions
|
## 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
|
## 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!
|
## Help out
|
||||||
|
|
||||||
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.
|
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
|
||||||
|
|
||||||
|
If you are submitting a pull request, please add your name to the list.
|
||||||
|
|
||||||
|
* Robert Evans
|
||||||
|
* David Bradford
|
||||||
|
* Rich Manalang
|
||||||
|
* Piotr Usewicz
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
alias em="emacs"
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
alias v='mvim --remote-tab'
|
||||||
|
|
@ -27,7 +27,6 @@ do
|
||||||
source $config_file
|
source $config_file
|
||||||
done
|
done
|
||||||
|
|
||||||
unset config_file
|
|
||||||
# Plugins
|
# Plugins
|
||||||
PLUGINS="${BASH}/plugins/*.bash"
|
PLUGINS="${BASH}/plugins/*.bash"
|
||||||
for config_file in $PLUGINS
|
for config_file in $PLUGINS
|
||||||
|
|
@ -35,8 +34,8 @@ do
|
||||||
source $config_file
|
source $config_file
|
||||||
done
|
done
|
||||||
|
|
||||||
# Functions
|
# Aliases
|
||||||
FUNCTIONS="${BASH}/functions/*.bash"
|
FUNCTIONS="${BASH}/aliases/*.bash"
|
||||||
for config_file in $FUNCTIONS
|
for config_file in $FUNCTIONS
|
||||||
do
|
do
|
||||||
source $config_file
|
source $config_file
|
||||||
|
|
@ -49,6 +48,8 @@ do
|
||||||
source $config_file
|
source $config_file
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
unset config_file
|
||||||
export PS1=$PROMPT
|
export PS1=$PROMPT
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
@ -13,7 +13,6 @@ export HISTCONTROL=erasedups
|
||||||
# resize history size
|
# resize history size
|
||||||
export HISTSIZE=5000
|
export HISTSIZE=5000
|
||||||
|
|
||||||
|
|
||||||
export AUTOFEATURE=true autotest
|
export AUTOFEATURE=true autotest
|
||||||
|
|
||||||
function rh {
|
function rh {
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,39 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Desktop Programs
|
# For generic functions.
|
||||||
alias fireworks="open -a '/Applications/Adobe Fireworks CS3/Adobe Fireworks CS3.app'"
|
|
||||||
alias photoshop="open -a '/Applications/Adobe Photoshop CS3/Adobe Photoshop.app'"
|
function ips {
|
||||||
alias preview="open -a '$PREVIEW'"
|
ifconfig | grep "inet " | awk '{ print $2 }'
|
||||||
alias xcode="open -a '/Developer/Applications/Xcode.app'"
|
}
|
||||||
alias filemerge="open -a '/Developer/Applications/Utilities/FileMerge.app'"
|
|
||||||
alias safari="open -a safari"
|
function myip {
|
||||||
alias firefox="open -a firefox"
|
res=$(curl -s checkip.dyndns.org | grep -Eo '[0-9\.]+')
|
||||||
alias dashcode="open -a dashcode"
|
echo "Your public IP is: ${bold_green} $res ${normal}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if [ -s /usr/bin/firefox ] ; then
|
# View man documentation in Preview
|
||||||
unalias firefox
|
pman () {
|
||||||
fi
|
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
|
||||||
|
}
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
alias em="emacs"
|
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
alias f='open -a Finder '
|
|
||||||
|
|
||||||
function tab() {
|
function tab() {
|
||||||
osascript 2>/dev/null <<EOF
|
osascript 2>/dev/null <<EOF
|
||||||
tell application "System Events"
|
tell application "System Events"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
alias v='mvim --remote-tab'
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue