Merge branch 'master' of git://github.com/revans/bash-it

pull/34/head
Rich Manalang 2010-12-13 13:38:10 -08:00
commit 33850711cc
51 changed files with 1191 additions and 297 deletions

7
.gitignore vendored
View File

@ -1,3 +1,8 @@
.DS_Store
custom/*.bash
!custom/example.bash
!custom/example.bash
.rvmrc
aliases/custom.aliases.bash
lib/custom.bash
plugins/custom.plugins.bash
*.swp

View File

@ -1,43 +1,69 @@
# Bash it
'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](https://github.com/robbyrussell/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, a few stolen pieces from Steve Losh, and more.
## Install
Check a clone of this repo. You can view what a sample ~/.bash\_profile looks like in template/bash\_profile.template.bash. If you wanted to use that template, make sure to make a backup of your current ~/.bash\_profile file.
Check a clone of this repo. You can view what a sample `~/.bash_profile` looks like in `template/bash_profile.template.bash`. If you wanted to use that template, make sure to make a backup of your current `~/.bash_profile` file.
<pre><code>
git clone http://github.com/revans/bash-it.git bash_it
git clone http://github.com/revans/bash-it.git bash_it
cp ~/.bash_profile ~/.bash_profile_original
cp <path/to/cloned/repo>/template/bash_profile.template.bash ~/.bash_profile
cp ~/.bash_profile ~/.bash_profile_original
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)
aliases-help
rails-help
git-help
</code></pre>
bash-it (will show all the help commands)
aliases-help
rails-help
git-help
plugins-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!
## 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
If you are submitting a pull request, please add your name to the list.
* [Robert Evans][revans]
* [David Bradford][zerobearing2]
* [Rich Manalang][manalang]
* [Piotr Usewicz][pusewicz]
* [Simon H. Eskildsen][sirupsen]
* [Mark Szymanski][mrman208]
* [Florian Baumann][noqqe]
* [Andy Shen][shenie]
* [John Schulz][jfsiii]
[revans]: http://github.com/revans
[zerobearing2]: http://github.com/zerobearing2
[manalang]: http://github.com/manalang
[pusewicz]: http://github.com/pusewicz
[sirupsen]: http://github.com/sirupsen
[mrman208]: http://github.com/mrman208
[noqqe]: http://github.com/noqqe
[shenie]: http://github.com/shenie
[jfsiii]: http://github.com/jfsiii
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.

View File

@ -0,0 +1,3 @@
#!/bin/bash
alias em="open -a emacs"

View File

@ -0,0 +1,67 @@
#!/bin/bash
# List directory contents
alias sl=ls
alias ls='ls -G' # Compact view, show colors
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -al'
alias l='ls -a'
alias l1='ls -1'
if [ $(uname) = "Linux" ]
then
alias ls="ls --color=always"
fi
alias c='clear'
alias k='clear'
alias edit="$EDITOR"
alias page="$PAGER"
alias q="exit"
alias irc="$IRC_CLIENT"
# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
alias piano="pianobar"
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias -- -="cd -" # Go back
# Shell History
alias h='history'
# Tree
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
# Directory
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v'
function aliases-help() {
echo "Generic Alias Usage"
echo
echo " sl = ls"
echo " ls = ls -G"
echo " la = ls -AF"
echo " ll = ls -al"
echo " l = ls -a"
echo " c/k = clear"
echo " .. = cd .."
echo " ... = cd ../.."
echo " - = cd -"
echo " h = history"
echo " md = mkdir -p"
echo " rd = rmdir"
echo " d = dirs -v"
echo " editor = $EDITOR"
echo " pager = $PAGER"
echo " piano = pianobar"
echo " q = exit"
echo " irc = $IRC_CLIENT"
echo
}

View File

@ -1,12 +1,18 @@
#!/bin/bash
# Aliases
alias gcl='git clone'
alias ga='git add'
alias gall='git add .'
alias g='git'
alias get='git'
alias gst='git status'
alias gs='git status'
alias gss='git status -s'
alias gl='git pull'
alias gup='git fetch && git rebase'
alias gp='git push'
alias gpo='git push origin'
alias gdv='git diff -w "$@" | vim -R -'
alias gc='git commit -v'
alias gca='git commit -v -a'
@ -16,6 +22,8 @@ alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gco='git checkout'
alias gexport='git archive --format zip --output'
alias gdel='git branch -D'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master'
case $OSTYPE in
linux*)
@ -33,9 +41,14 @@ esac
function git-help() {
echo "Git Custom Aliases Usage"
echo
echo
echo " gcl = git clone"
echo " g = git"
echo " get = git"
echo " ga = git add"
echo " gall = git add ."
echo " gst/gs = git status"
echo " gss = git status -s"
echo " gl = git pull"
echo " gup = git fetch && git rebase"
echo " gp = git push"
@ -49,5 +62,8 @@ function git-help() {
echo " gcp = git cherry-pick"
echo " gco = git checkout"
echo " gexport = git git archive --format zip --output"
echo
}
echo " gdel = git branch -D"
echo " gpo = git push origin"
echo " gmu = git fetch origin -v; git fetch upstream -v; git merge upstream/master"
echo
}

View File

@ -0,0 +1,14 @@
#!/bin/bash
alias hs='hg status'
alias hsum='hg summary'
alias hcm='hg commit -m'
function hg-help() {
echo "Mercurial Alias Help"
echo
echo " hs = hg status"
echo " hsum = hg summary"
echo " hcm = hg commit -m"
echo
}

View File

@ -0,0 +1,27 @@
# Open the root of your site in your vim or builtin cd to it
if [[ $EDITOR = "vim" ]]
then alias newentry="builtin cd $JEKYLL_LOCAL_ROOT && $EDITOR ."
else alias newentry="builtin cd $JEKYLL_LOCAL_ROOT"
fi
# Open the _posts/ directory for making a new blog post (seperate from above alias because not everyone uses jekyll for a blog)
# if [ $editor = "vim" ]
# then
# alias newpost="builtin cd $jekyll_local_root/_posts && $editor ."
# else
# alias newpost="builtin cd $jekyll_local_root"
# fi
# Build and locally serve the site
alias testsite="builtin cd $JEKYLL_LOCAL_ROOT && jekyll --server --auto"
# Build but don't locally serve the site
alias buildsite="builtin cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll"
# Rsync the site to the remote server
alias deploysite="builtin cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT"

View File

@ -0,0 +1,19 @@
#!/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 chrome="open -a google\ chrome"
alias chromium="open -a chromium"
alias dashcode="open -a dashcode"
alias f='open -a Finder '
if [ -s /usr/bin/firefox ] ; then
unalias firefox
fi

View File

@ -0,0 +1,19 @@
#!/bin/bash
alias tls="$TODO ls"
alias ta="$TODO a"
alias trm="$TODO rm"
alias tdo="$TODO do"
alias tpri="$TODO pri"
todo-help() {
echo
echo "todo.txt-cli Custom Aliases Usage"
echo
echo " tls = $TODO ls"
echo " ta = $TODO add"
echo " trm = $TODO rm"
echo " tdo = $TODO do"
echo " tpri = $TODO pri"
echo
}

View File

@ -0,0 +1,3 @@
#!/bin/bash
alias v='mvim --remote-tab'

View File

@ -4,14 +4,11 @@
# Reload Library
alias reload='source ~/.bash_profile'
# Load all files
# Load the framework
# Themes
THEMES="${BASH}/themes/*.bash"
for config_file in $THEMES
do
source $config_file
done
# Load colors first so they can be use in base theme
source "${BASH}/themes/colors.theme.bash"
source "${BASH}/themes/base.theme.bash"
# Library
LIB="${BASH}/lib/*.bash"
@ -27,7 +24,6 @@ do
source $config_file
done
unset config_file
# Plugins
PLUGINS="${BASH}/plugins/*.bash"
for config_file in $PLUGINS
@ -35,8 +31,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,8 +45,11 @@ do
source $config_file
done
export PS1=$PROMPT
unset config_file
if [[ $PROMPT ]]; then
export PS1=$PROMPT
fi
# Adding Support for other OSes
PREVIEW="less"
@ -68,7 +67,8 @@ function bash-it() {
echo
echo " rails-help This will list out all the aliases you can use with rails."
echo " git-help This will list out all the aliases you can use with git."
echo " todo-help This will list out all the aliases you can use with todo.txt-cli"
echo " aliases-help Generic list of aliases."
echo " plugins-help This will list out all the plugins and functions you can use with bash-it"
echo
}
}

View File

@ -1,4 +1,4 @@
if [ `which brew` ]; then
if which brew >/dev/null 2>&1; then
if [ -f `brew --prefix`/Library/Contributions/brew_bash_completion.sh ]; then
. `brew --prefix`/Library/Contributions/brew_bash_completion.sh
fi

View File

@ -0,0 +1,23 @@
#!/bin/bash
# Bash completion support for ssh.
export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/}
_sshcomplete() {
# parse all defined hosts from .ssh/config
if [ -r $HOME/.ssh/config ]; then
COMPREPLY=($(compgen -W "$(grep ^Host $HOME/.ssh/config | awk '{print $2}' )" -- ${COMP_WORDS[COMP_CWORD]}))
fi
# parse all hosts found in .ssh/known_hosts
if [ -r $HOME/.ssh/known_hosts ]; then
if grep -v -q -e '^ ssh-rsa' $HOME/.ssh/known_hosts ; then
COMPREPLY=( $COMPREPLY $(compgen -W "$( awk '{print $1}' $HOME/.ssh/known_hosts | cut -d, -f 1 | sed -e 's/\[//g' | sed -e 's/\]//g' | cut -d: -f1 | grep -v ssh-rsa)" -- ${COMP_WORDS[COMP_CWORD]} ))
fi
fi
return 0
}
complete -o default -o nospace -F _sshcomplete ssh

View File

@ -0,0 +1,34 @@
_todo()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
COMMANDS="add a addto addm append app archive command del \
rm depri dp do help list ls listall lsa listcon \
lsc listfile lf listpri lsp listproj lsproj move \
mv prepend prep pri p replace report"
# Add custom commands from add-ons, if installed.
COMMANDS="$COMMANDS $('ls' ${TODO_ACTIONS_DIR:-$HOME/.todo.actions.d}/ 2>/dev/null)"
OPTS="-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x"
if [ $COMP_CWORD -eq 1 ]; then
completions="$COMMANDS $OPTS"
else
case "${prev}" in
-*) completions="$COMMANDS $OPTS";;
*) return 0;;
esac
fi
COMPREPLY=( $( compgen -W "$completions" -- $cur ))
return 0
}
complete -F _todo todo.sh
# If you define an alias (e.g. "t") to todo.sh, you need to explicitly enable
# completion for it, too:
complete -F _todo t

View File

@ -1,4 +1,4 @@
#!/bin/bash
#
# This is an example file. Don't use this for your custom scripts. Instead, created another file within the
# custom directory.
# This is an example file. Don't use this for your custom scripts. Instead, create another file within the
# custom directory.

View File

@ -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
}

View File

@ -1,20 +0,0 @@
#!/bin/bash
function git_remote {
echo "Running: git remote add origin ${GIT_HOSTING}:$1.git"
git remote add origin $GIT_HOSTING:$1.git
}
function git_first_push {
echo "Running: git push origin master:refs/heads/master"
git push origin master:refs/heads/master
}
function git_remove_missing_files() {
git ls-files -d -z | xargs -0 git update-index --remove
}
# Adds files to git's exclude file (same as .gitignore)
function local-ignore() {
echo "$1" >> .git/info/exclude
}

View File

@ -1,42 +0,0 @@
#!/bin/bash
# List directory contents
alias sl=ls
alias ls='ls -G' # Compact view, show colors
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -al'
alias l='ls -a'
alias c='clear'
alias k='clear'
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias -- -="cd -" # Go back
# Shell History
alias h='history'
# Directory
alias md='mkdir -p'
alias rd=rmdir
alias d='dirs -v'
function aliases-help() {
echo "Generic Alias Usage"
echo
echo " sl = ls"
echo " ls = ls -G"
echo " la = ls -AF"
echo " ll = ls -al"
echo " l = ls -a"
echo " c/k = clear"
echo " .. = cd .."
echo " ... = cd ../.."
echo " - = cd -"
echo " h = history"
echo " md = mkdir -p"
echo " rd = rmdir"
echo " d = dirs -v"
echo
}

View File

@ -8,4 +8,6 @@ export GREP_COLOR='1;33'
export LSCOLORS='Gxfxcxdxdxegedabagacad'
# Load the theme
source "$BASH/themes/$BASH_THEME/$BASH_THEME.theme.bash"
if [[ $BASH_THEME ]]; then
source "$BASH/themes/$BASH_THEME/$BASH_THEME.theme.bash"
fi

View File

@ -13,7 +13,6 @@ export HISTCONTROL=erasedups
# resize history size
export HISTSIZE=5000
export AUTOFEATURE=true autotest
function rh {

View File

@ -1,16 +1,90 @@
#!/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"
# 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}"
}
function mkcd(){
mkdir -p "$*"
cd "$*"
}
# 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
}
quiet() {
$* &> /dev/null &
}
banish-cookies() {
rm -r ~/.macromedia ~/.adobe
ln -s /dev/null ~/.adobe
ln -s /dev/null ~/.macromedia
}
# disk usage per directory
# in Mac OS X and Linux
usage ()
{
if [ $(uname) = "Darwin" ]; then
if [ -n $1 ]; then
du -hd $1
else
du -hd 1
fi
elif [ $(uname) = "Linux" ]; then
if [ -n $1 ]; then
du -h --max-depth=1 $1
else
du -h --max-depth=1
fi
fi
}
# One thing todo
function t() {
if [[ "$*" == "" ]] ; then
cat ~/.t
else
echo "$*" > ~/.t
fi
}
# List all plugins and functions defined by bash-it
function plugins-help() {
echo "bash-it Plugins Help-Message"
echo
set | grep "()" \
| sed -e "/^_/d" | grep -v "BASH_ARGC=()" \
| sed -e "/^\s/d" | grep -v "BASH_LINENO=()" \
| grep -v "BASH_ARGV=()" \
| grep -v "BASH_SOURCE=()" \
| grep -v "DIRSTACK=()" \
| grep -v "GROUPS=()" \
| grep -v "BASH_CMDS=()" \
| grep -v "BASH_ALIASES=()" \
| grep -v "COMPREPLY=()" | sed -e "s/()//"
}
if [ -s /usr/bin/firefox ] ; then
unalias firefox
fi

View File

@ -0,0 +1,29 @@
# based on https://gist.github.com/318247
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo "<h1>hi mom!</h1>" | browser
# $ ron -5 man/rip.5.ron | browser
function browser() {
if [ -t 0 ]; then
if [ -n "$1" ]; then
open $1
else
cat <<usage
Usage: browser
pipe html to a browser
$ echo '<h1>hi mom!</h1>' | browser
$ ron -5 man/rip.5.ron | browser
usage
fi
else
f="/tmp/browser.$RANDOM.html"
cat /dev/stdin > $f
open $f
fi
}

View File

@ -1 +0,0 @@
alias em="emacs"

View File

@ -0,0 +1,56 @@
#!/bin/bash
function git_remote {
echo "Running: git remote add origin ${GIT_HOSTING}:$1.git"
git remote add origin $GIT_HOSTING:$1.git
}
function git_first_push {
echo "Running: git push origin master:refs/heads/master"
git push origin master:refs/heads/master
}
function git_remove_missing_files() {
git ls-files -d -z | xargs -0 git update-index --remove
}
# Adds files to git's exclude file (same as .gitignore)
function local-ignore() {
echo "$1" >> .git/info/exclude
}
# get a quick overview for your git repo
function git_info() {
if [ -n "$(git symbolic-ref HEAD 2> /dev/null)" ]; then
# print informations
echo "git repo overview"
echo "-----------------"
echo
# print all remotes and thier details
for remote in $(git remote show); do
echo $remote:
git remote show $remote
echo
done
# print status of working repo
echo "status:"
if [ -n "$(git status -s 2> /dev/null)" ]; then
git status -s
else
echo "working directory is clean"
fi
# print at least 5 last log entries
echo
echo "log:"
git log -5 --oneline
echo
else
echo "you're currently not in a git repository"
fi
}

View File

@ -0,0 +1,116 @@
#!/bin/bash
# hcht.plugin.bash: the handmade commandline history tool
# Copyright: (C) 2010 Florian Baumann <flo@noqqe.de>
# License: GPL-3 <http://www.gnu.org/licenses/gpl-3.0.txt>
# Date: Dienstag 2010-11-30
### readme
# basiclly the handmade commandline history tool was made for storing
# informations. yeah, you're right. sounds a bit boring. many other
# applications can do this much better. but storing things from commandline?
#
# hcht was fitted to work at your terminal.
# your daily stuff like notices, todos, commands or output from a command.
# all these things will be stored without complex syntax.
#
# once you defined your storing-directory you will be able to easily
# save all the stuff listed above.
#
### create a file
# the basic feature. open a file, do stuff and save.
#
# $ hcht evilcommand.hch
#
# this will create a new file or edit a existing one.
# paste your command or notice in your favorite editor
### show all stored informations
# to get an overview of your storedir:
#
# $ hcht
### todo with a whole sentence
# you can give hcht a bunch of parameters
#
# $ hcht this is a long reminder about a anything
### save last executed command
# lets say you did a great hack at your system and you
# want to save it without complicated use of coping:
#
# $ hcht !!
#
# the "!!" will repeat the _last_ command you executed at
# your terminal. after asking you about a name the hch file
# will be saved.
### read from stdin
# hcht is also able to read anything from stdin.
#
# $ cat any_important_logfile | hcht anylog
#
# "anylog" will be the name of the saved file.
hcht() {
# configured?
if [ -z $hchtstoredir ]; then
echo "ERROR: handmade commandline history tool isn't configured."
return 1
else
hchtstoredir=$(echo $hchtstoredir | sed -e 's/\/$//')
fi
# dir available?
if [ ! -d $hchtstoredir ]; then
echo "ERROR: No such directory: $hchtstoredir"
return 1
fi
# get favorite editor
if [ -z $EDITOR ]; then
EDITOR=$(which vim || which nano)
fi
# check if stdin-data is present and save content
if [ "$(tty)" = "not a tty" ]; then
hchname=$(echo $1 | sed -e 's/\ //g')
if [ -z $hchname ]; then
cat < /dev/stdin >> $hchtstoredir/$(date +%Y%m%d%H%M%S).hch
else
cat < /dev/stdin >> $hchtstoredir/$hchname.hch
fi
return 0
fi
# list all hch files if no parameter is given
if [ $# -eq 0 ]; then
for file in $(ls $hchtstoredir); do
echo $file
done
return 0
fi
# if a *.hch file is given start editing or creating it
if [ "$#" -eq "1" ]; then
if echo "$1" | grep -q -e ".*.hch$" ; then
$EDITOR ${hchtstoredir}/${1}
return 0
else
$EDITOR ${hchtstoredir}/${1}.hch
return 0
fi
fi
# autocreate a new hch
if [ "$#" -gt "1" ]; then
echo -n "define a name: " ; read hchname
hchname=$(echo $hchname | sed -e 's/\ /_/g')
if [ -z "$hchname" ]; then
echo "$*" > $hchtstoredir/${1}-$(date +%Y%m%d%H%M%S).hch
else
echo "$*" > ${hchtstoredir}/${hchname}.hch
fi
return 0
fi
}

View File

@ -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
}

View File

@ -0,0 +1,182 @@
#!/bin/bash
newpost() {
# 'builtin cd' into the local jekyll root
builtin cd "$JEKYLL_LOCAL_ROOT/_posts"
# Get the date for the new post's filename
FNAME_DATE=$(date "+%Y-%m-%d")
# If the user is using markdown formatting, let them choose what type of post they want. Sort of like Tumblr.
OPTIONS="Text Quote Image Audio Video Link"
if [ $JEKYLL_FORMATTING = "markdown" -o $JEKYLL_FORMATTING = "textile" ]
then
select OPTION in $OPTIONS
do
if [[ $OPTION = "Text" ]]
then
POST_TYPE="Text"
break
fi
if [[ $OPTION = "Quote" ]]
then
POST_TYPE="Quote"
break
fi
if [[ $OPTION = "Image" ]]
then
POST_TYPE="Image"
break
fi
if [[ $OPTION = "Audio" ]]
then
POST_TYPE="Audio"
break
fi
if [[ $OPTION = "Video" ]]
then
POST_TYPE="Video"
break
fi
if [[ $OPTION = "Link" ]]
then
POST_TYPE="Link"
break
fi
done
fi
# Get the title for the new post
read -p "Enter title of the new post: " POST_TITLE
# Convert the spaces in the title to hyphens for use in the filename
FNAME_POST_TITLE=`echo $POST_TITLE | tr ' ' "-"`
# Now, put it all together for the full filename
FNAME="$FNAME_DATE-$FNAME_POST_TITLE.$JEKYLL_FORMATTING"
# And, finally, create the actual post file. But we're not done yet...
touch "$FNAME"
# Write a little stuff to the file for the YAML Front Matter
echo "---" >> $FNAME
# Now we have to get the date, again. But this time for in the header (YAML Front Matter) of
# the file
YAML_DATE=$(date "+%B %d %X")
# Echo the YAML Formatted date to the post file
echo "date: $YAML_DATE" >> $FNAME
# Echo the original post title to the YAML Front Matter header
echo "title: $POST_TITLE" >> $FNAME
# And, now, echo the "post" layout to the YAML Front Matter header
echo "layout: post" >> $FNAME
# Close the YAML Front Matter Header
echo "---" >> $FNAME
echo >> $FNAME
# Generate template text based on the post type
if [[ $JEKYLL_FORMATTING = "markdown" ]]
then
if [[ $POST_TYPE = "Text" ]]
then
true
fi
if [[ $POST_TYPE = "Quote" ]]
then
echo "> Quote" >> $FNAME
echo >> $FNAME
echo "&mdash; Author" >> $FNAME
fi
if [[ $POST_TYPE = "Image" ]]
then
echo "![Alternate Text](/path/to/image/or/url)" >> $FNAME
fi
if [[ $POST_TYPE = "Audio" ]]
then
echo "<html><audio src=\"/path/to/audio/file\" controls=\"controls\"></audio></html>" >> $FNAME
fi
if [[ $POST_TYPE = "Video" ]]
then
echo "<html><video src=\"/path/to/video\" controls=\"controls\"></video></html>" >> $FNAME
fi
if [[ $POST_TYPE = "Link" ]]
then
echo "[link][1]" >> $FNAME
echo >> $FNAME
echo "> Quote" >> $FNAME
echo >> $FNAME
echo "[1]: url" >> $FNAME
fi
fi
if [[ $JEKYLL_FORMATTING = "textile" ]]
then
if [[ $POST_TYPE = "Text" ]]
then
true
fi
if [[ $POST_TYPE = "Quote" ]]
then
echo "bq. Quote" >> $FNAME
echo >> $FNAME
echo "&mdash; Author" >> $FNAME
fi
if [[ $POST_TYPE = "Image" ]]
then
echo "!url(alt text)" >> $FNAME
fi
if [[ $POST_TYPE = "Audio" ]]
then
echo "<html><audio src=\"/path/to/audio/file\" controls=\"controls\"></audio></html>" >> $FNAME
fi
if [[ $POST_TYPE = "Video" ]]
then
echo "<html><video src=\"/path/to/video\" controls=\"controls\"></video></html>" >> $FNAME
fi
if [[ $POST_TYPE = "Link" ]]
then
echo "\"Site\":url" >> $FNAME
echo >> $FNAME
echo "bq. Quote" >> $FNAME
fi
fi
# Open the file in your favorite editor
$EDITOR $FNAME
}

View File

@ -1,7 +1,5 @@
#!/bin/bash
alias f='open -a Finder '
function tab() {
osascript 2>/dev/null <<EOF
tell application "System Events"
@ -13,3 +11,27 @@ function tab() {
end tell
EOF
}
# this one switches your os x dock between 2d and 3d
# thanks to savier.zwetschge.org
function dock-switch() {
if [ $(uname) = "Darwin" ]; then
if [ $1 = 3d ] ; then
defaults write com.apple.dock no-glass -boolean NO
killall Dock
elif [ $1 = 2d ] ; then
defaults write com.apple.dock no-glass -boolean YES
killall Dock
else
echo "usage:"
echo "dock-switch 2d"
echo "dock-switch 3d."
fi
else
echo "sorry. you're currently not using os x"
fi
}

View File

@ -13,4 +13,4 @@ rvm_default () {
function rvm_version () {
ruby --version
}
}

View File

@ -0,0 +1,9 @@
#!/bin/bash
function add_ssh() {
echo -en "\n\nHost $1\n HostName $2\n User $3\n ServerAliveInterval 30\n ServerAliveCountMax 120" >> ~/.ssh/config
}
function sshlist() {
awk '$1 ~ /Host$/ { print $2 }' ~/.ssh/config
}

View File

@ -0,0 +1,50 @@
#!/bin/bash
_vagrant()
{
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
commands="box destroy halt help init package provision reload resume ssh ssh_config status suspend up version"
if [ $COMP_CWORD == 1 ]
then
COMPREPLY=($(compgen -W "${commands}" -- ${cur}))
return 0
fi
if [ $COMP_CWORD == 2 ]
then
case "$prev" in
"box")
box_commands="add help list remove repackage"
COMPREPLY=($(compgen -W "${box_commands}" -- ${cur}))
return 0
;;
"help")
COMPREPLY=($(compgen -W "${commands}" -- ${cur}))
return 0
;;
*)
;;
esac
fi
if [ $COMP_CWORD == 3 ]
then
action="${COMP_WORDS[COMP_CWORD-2]}"
if [ $action == 'box' ]
then
case "$prev" in
"remove"|"repackage")
local box_list=$(find $HOME/.vagrant/boxes/* -maxdepth 0 -type d -printf '%f ')
COMPREPLY=($(compgen -W "${box_list}" -- ${cur}))
return 0
;;
*)
;;
esac
fi
fi
}
complete -F _vagrant vagrant

View File

@ -1,4 +0,0 @@
#!/bin/bash
alias v='mvim --remote-tab'

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Load RVM
# Load RVM, if you are using it
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
# Add rvm gems and nginx to the path
@ -17,7 +17,7 @@ export BASH_THEME='bobby'
export GIT_HOSTING='git@git.domain.com'
# Set my editor and git editor
export EDITOR="/usr/bin/mate -w"
export EDITOR="/usr/bin/mate -w"
export GIT_EDITOR='/usr/bin/mate -w'
# Set the path nginx
@ -26,5 +26,29 @@ export NGINX_PATH='/opt/nginx'
# Don't check mail when opening terminal.
unset MAILCHECK
# Change this to the path of your local jekyll root to use the jekyll aliases
export JEKYLL_LOCAL_ROOT="$HOME/Sites/jekyllsite"
# And change this to the remote server and root
export JEKYLL_REMOTE_ROOT="user@server:/path/to/jekyll/root"
# And, for the last of the jekyll variables, this is the formatting you use, eg: markdown,
# textile, etc. Basically whatever you use as the extension for posts, without the preceding dot
export JEKYLL_FORMATTING="markdown"
# Change this to your console based IRC client of choice.
export IRC_CLIENT='irssi'
# Set this to the command you use for todo.txt-cli
export TODO="t"
# Set store directory for handmade commandline history tool
export hchtstoredir="$HOME/.hcht"
# Load Bash It
source $BASH/bash_it.sh

View File

@ -1,21 +1,84 @@
#!/bin/bash
# Stolen from Steve Losh
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
hg root >/dev/null 2>/dev/null && echo '☿' && return
echo '○'
}
SCM_THEME_PROMPT_DIRTY=' ✗'
SCM_THEME_PROMPT_CLEAN=' ✓'
SCM_THEME_PROMPT_PREFIX=' |'
SCM_THEME_PROMPT_SUFFIX='|'
function parse_git_dirty {
if [[ -n $(git status -s 2> /dev/null) ]]; then
echo "$GIT_THEME_PROMPT_DIRTY"
else
echo "$GIT_THEME_PROMPT_CLEAN"
GIT='git'
SCM_GIT_CHAR='±'
HG='hg'
SCM_HG_CHAR='☿'
SVN='svn'
SCM_SVN_CHAR='⑆'
SCM_NONE_CHAR='○'
RVM_THEME_PROMPT_PREFIX=' |'
RVM_THEME_PROMPT_SUFFIX='|'
function scm {
if [[ -d .git ]]; then SCM=$GIT
elif [[ -d .hg ]]; then SCM=$HG
elif [[ -d .svn ]]; then SCM=$SVN
else SCM='NONE'
fi
}
function git_prompt_info() {
function scm_char {
if [[ -z $SCM ]]; then scm; fi
[[ $SCM == $GIT ]] && echo $SCM_GIT_CHAR && return
[[ $SCM == $HG ]] && echo $SCM_HG_CHAR && return
[[ $SCM == $SVN ]] && echo $SCM_SVN_CHAR && return
echo $SCM_NONE_CHAR
}
function scm_prompt_info {
if [[ -z $SCM ]]; then scm; fi
[[ $SCM == $GIT ]] && git_prompt_info && return
[[ $SCM == $HG ]] && hg_prompt_info && return
[[ $SCM == $SVN ]] && svn_prompt_info && return
}
# Stolen from Steve Losh
# left in for backwards-compatibility
function prompt_char {
char=$(scm_char);
echo -e "$char"
}
function git_prompt_info {
if [[ -n $(git status -s 2> /dev/null |grep -v ^# |grep -v "working directory clean") ]]; then
state=${GIT_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY}
else
state=${GIT_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
fi
prefix=${GIT_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX}
suffix=${GIT_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX}
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$GIT_THEME_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$GIT_THEME_PROMPT_SUFFIX"
}
echo -e "$prefix${ref#refs/heads/}$state$suffix"
}
function svn_prompt_info {
if [[ -n $(svn status 2> /dev/null) ]]; then
state=${SVN_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY}
else
state=${SVN_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN}
fi
prefix=${SVN_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX}
suffix=${SVN_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX}
ref=$(svn info 2> /dev/null | awk -F/ '/^URL:/ { for (i=0; i<=NF; i++) { if ($i == "branches" || $i == "tags" ) { print $(i+1); break }; if ($i == "trunk") { print $i; break } } }') || return
[[ -z $ref ]] && return
echo -e "$prefix$ref$state$suffix"
}
function rvm_version_prompt {
if which rvm &> /dev/null; then
rvm=$(rvm tools identifier) || return
echo -e "$RVM_THEME_PROMPT_PREFIX$rvm$RVM_THEME_PROMPT_SUFFIX"
fi
}

View File

@ -1,26 +1,19 @@
#!/bin/bash
# prompt themeing
#added TITLEBAR for updating the tab and window titles with the pwd
case $TERM in
xterm*)
TITLEBAR='\[\033]0;\w\007\]'
;;
*)
TITLEBAR=""
;;
esac
PROMPT="${TITLEBAR}${bold_blue}\$(prompt_char)\$(git_prompt_info) ${orange}\h ${reset_color}in ${green}\w ${reset_color}"
SCM_THEME_PROMPT_DIRTY=" ${red}"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}"
SCM_THEME_PROMPT_PREFIX=" |"
SCM_THEME_PROMPT_SUFFIX="${green}|"
# git themeing
# GIT_THEME_PROMPT_DIRTY=" ${red}✗"
# GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
# GIT_THEME_PROMPT_PREFIX=" ${green}|"
# GIT_THEME_PROMPT_SUFFIX="${green}|"
PROMPT="\[${bold_blue}\]\[\$(scm_char)\]\[${green}\]\[\$(scm_prompt_info)\]\[${blue}\]\[\$(rvm_version_prompt)\] \[${orange}\]\h \[${reset_color}\]in \[${green}\]\w \[${reset_color}\]\[\n\[${green}\]→\[${reset_color}\] "
# git theming
GIT_THEME_PROMPT_DIRTY=" ${red}"
GIT_THEME_PROMPT_CLEAN=" ${bold_green}"
GIT_THEME_PROMPT_PREFIX=" ${green}|"
GIT_THEME_PROMPT_SUFFIX="${green}|"
RVM_THEME_PROMPT_PREFIX=" |"
RVM_THEME_PROMPT_SUFFIX="|"
GIT_THEME_PROMPT_DIRTY=" ✗"
GIT_THEME_PROMPT_CLEAN=" ✓"
GIT_THEME_PROMPT_PREFIX=" |"
GIT_THEME_PROMPT_SUFFIX="|"

View File

@ -1,2 +1,2 @@
#!/bin/bash
PROMPT='${green}\u@\h ${blue}\T ${reset_color}${white}\w${reset_color}$(git_prompt_info)${blue} →${bold_blue} \$${reset_color} '
PROMPT="${green}\u@\h ${blue}\T ${reset_color}${white}\w${reset_color}\[\$(scm_prompt_info)\]${blue}${bold_blue} \$${reset_color} "

View File

@ -1,6 +1,6 @@
if [ "$(whoami)" = root ]; then no_color=$red; else no_color=$white; fi
PROMPT='${no_color}\u${reset_color}:${blue}\W/${reset_color} $(git_prompt_info)$ '
PROMPT="${no_color}\u${reset_color}:${blue}\W/${reset_color} \[\$(scm_prompt_info)\]$ "
RPROMPT='[\t]'

View File

@ -1,79 +1,44 @@
#!/bin/bash
# green=$'\e[0;32m'
# red=$'\e[0;31m'
# blue=$'\e[0;34m'
# white=$'\e[1;37m'
# black=$'\e[0;30m'
# yellow=$'\e[0;33m'
# purple=$'\e[0;35m'
# cyan=$'\e[0;36m'
# orange=$'\e[33;40m'
#
#
# bold_green=$'\e[1;32m'
# bold_red=$'\e[1;31m'
# bold_blue=$'\e[1;34m'
# bold_yellow=$'\e[1;33m'
# bold_purple=$'\e[1;35m'
# bold_cyan=$'\e[1;36m'
# bold_orange=$'\e[1;33;40m'
#
# normal=$'\e[00m'
# reset_color=$'\e[39m'
black=$'\e[0;30m'
red=$'\e[0;31m'
green=$'\e[0;32m'
yellow=$'\e[0;33m'
blue=$'\e[0;34m'
purple=$'\e[0;35m'
cyan=$'\e[0;36m'
white=$'\e[1;37m'
orange=$'\e[33;40m'
bold_black=$'\e[1;30m'
bold_red=$'\e[1;31m'
bold_green=$'\e[1;32m'
bold_yellow=$'\e[1;33m'
bold_blue=$'\e[1;34m'
bold_purple=$'\e[1;35m'
bold_cyan=$'\e[1;36m'
bold_white=$'\e[1;37m'
bold_orange=$'\e[1;33;40m'
underline_black=$'\e[4;30m'
underline_red=$'\e[4;31m'
underline_green=$'\e[4;32m'
underline_yellow=$'\e[4;33m'
underline_blue=$'\e[4;34m'
underline_purple=$'\e[4;35m'
underline_cyan=$'\e[4;36m'
underline_white=$'\e[4;37m'
underline_orange=$'\e[4;33;40m'
background_black=$'\e[40m'
background_red=$'\e[41m'
background_green=$'\e[42m'
background_yellow=$'\e[43m'
background_blue=$'\e[44m'
background_purple=$'\e[45m'
background_cyan=$'\e[46m'
background_white=$'\e[47m'
ESC="\033"
NON_BOLD=0
BOLD=1
# Foreground
FG_BLACK=30
FG_RED=31
FG_GREEN=32
FG_YELLOW=33
FG_BLUE=34
FG_VIOLET=35
FG_CYAN=36
FG_WHITE=37
FG_ORANGE='33;40'
FG_NULL=00
# Background
BG_BLACK=40
BG_RED=41
BG_GREEN=42
BG_YELLOW=43
BG_BLUE=44
BG_VIOLET=45
BG_CYAN=46
BG_WHITE=47
BG_NULL=00
normal="\[$ESC[m\]"
reset_color="\[$ESC[${NON_BOLD};${FG_WHITE};${BG_NULL}m\]"
# Non-bold
black="\[$ESC[${NON_BOLD};${FG_BLACK}m\]"
red="\[$ESC[${NON_BOLD};${FG_RED}m\]"
green="\[$ESC[${NON_BOLD};${FG_GREEN}m\]"
yellow="\[$ESC[${NON_BOLD};${FG_YELLOW}m\]"
blue="\[$ESC[${NON_BOLD};${FG_BLUE}m\]"
purple="\[$ESC[${NON_BOLD};${FG_VIOLET}m\]"
cyan="\[$ESC[${NON_BOLD};${FG_CYAN}m\]"
white="\[$ESC[${NON_BOLD};${FG_WHITE}m\]"
orange="\[$ESC[${NON_BOLD};${FG_ORANGE}m\]"
# Bold
bold_black="\[$ESC[${BOLD};${FG_BLACK}m\]"
bold_red="\[$ESC[${BOLD};${FG_RED}m\]"
bold_green="\[$ESC[${BOLD};${FG_GREEN}m\]"
bold_yellow="\[$ESC[${BOLD};${FG_YELLOW}m\]"
bold_blue="\[$ESC[${BOLD};${FG_BLUE}m\]"
bold_purple="\[$ESC[${BOLD};${FG_VIOLET}m\]"
bold_cyan="\[$ESC[${BOLD};${FG_CYAN}m\]"
bold_white="\[$ESC[${BOLD};${FG_WHITE}m\]"
bold_orange="\[$ESC[${BOLD};${FG_ORANGE}m\]"
normal=$'\e[00m'
reset_color=$'\e[39m'

View File

@ -0,0 +1,21 @@
prompt_setter() {
if [[ $? -eq 0 ]]; then
if [ ! $VIMRUNTIME = "" ]
then
PS1="{vim} \W "
else
PS1="\W "
fi
else
if [ ! $VIMRUNTIME = "" ]
then
PS1="{vim} ${bold_red}\W ${normal}"
else
PS1="${bold_red}\W ${normal}"
fi
fi
}
PROMPT_COMMAND=prompt_setter
export PS3=">> "

View File

@ -0,0 +1,35 @@
SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""
SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}'
SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}'
SCM_GIT_CHAR='${bold_green}±${normal}'
SCM_SVN_CHAR='${bold_cyan}⑆${normal}'
SCM_HG_CHAR='${bold_red}☿${normal}'
modern_scm_prompt() {
CHAR=$(scm_char)
if [ $CHAR = $SCM_NONE_CHAR ]
then
return
else
echo "[$(scm_char)][$(scm_prompt_info)]"
fi
}
prompt() {
if [ $? -ne 0 ]
then
PS1="${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}]
${bold_red}└─▪${normal} "
else
PS1="┌─$(modern_scm_prompt)[${cyan}\W${normal}]
└─▪ "
fi
}
PS2="└─▪ "
PROMPT_COMMAND=prompt

View File

@ -0,0 +1,22 @@
#!/bin/bash
# n0qorg theme by Florian Baumann <flo@noqqe.de>
## look-a-like
# host directory (branch*)»
# for example:
# ananas ~/Code/bash-it/themes (master*)»
PROMPT="${bold_blue}\[\$(hostname)\]${normal} \w${normal} ${bold_white}\[\$(git_prompt_info)\]${normal}» "
## git-theme
# feel free to change git chars.
GIT_THEME_PROMPT_DIRTY="${bold_blue}*${bold_white}"
GIT_THEME_PROMPT_CLEAN=""
GIT_THEME_PROMPT_PREFIX="${bold_blue}(${bold_white}"
GIT_THEME_PROMPT_SUFFIX="${bold_blue})"
## alternate chars
#
SCM_THEME_PROMPT_DIRTY="*"
SCM_THEME_PROMPT_CLEAN=""
SCM_THEME_PROMPT_PREFIX="("
SCM_THEME_PROMPT_SUFFIX=")"

View File

@ -0,0 +1,20 @@
#!/bin/bash
prompt_setter() {
# Save history
history -a
history -c
history -r
PS1="(\t) $(scm_char) [\[$blue\]\u\[$reset_color\]@\[$green\]\H\[$reset_color\]] \[$yellow\]\w\[$reset_color\]$(scm_prompt_info)$(rvm_version_prompt) $\[$reset_color\] "
PS2='> '
PS4='+ '
}
PROMPT_COMMAND=prompt_setter
SCM_THEME_PROMPT_DIRTY=" ✗"
SCM_THEME_PROMPT_CLEAN=" ✓"
SCM_THEME_PROMPT_PREFIX=" ("
SCM_THEME_PROMPT_SUFFIX=")"
RVM_THEME_PROMPT_PREFIX=" ("
RVM_THEME_PROMPT_SUFFIX=")"

View File

@ -11,16 +11,11 @@ case $TERM in
TITLEBAR=""
;;
esac
PROMPT="${TITLEBAR}${orange}${reset_color}${green}\w${bold_blue}\$(git_prompt_info)${reset_color} "
PROMPT="${TITLEBAR}${orange}${reset_color}${green}\w${bold_blue}\[\$(scm_prompt_info)\]${reset_color} "
# git themeing
# GIT_THEME_PROMPT_DIRTY=" ${red}✗"
# GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
# GIT_THEME_PROMPT_PREFIX=" ${green}|"
# GIT_THEME_PROMPT_SUFFIX="${green}|"
GIT_THEME_PROMPT_DIRTY=" ✗"
GIT_THEME_PROMPT_CLEAN=" ✓"
GIT_THEME_PROMPT_PREFIX="("
GIT_THEME_PROMPT_SUFFIX=")"
# scm themeing
SCM_THEME_PROMPT_DIRTY=" ✗"
SCM_THEME_PROMPT_CLEAN=" ✓"
SCM_THEME_PROMPT_PREFIX="("
SCM_THEME_PROMPT_SUFFIX=")"

View File

@ -0,0 +1,18 @@
# For unstaged(*) and staged(+) values next to branch name in __git_ps1
GIT_PS1_SHOWDIRTYSTATE="enabled"
function rvm_version_prompt {
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}')
[ "$gemset" != "" ] && gemset="@$gemset"
local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $2}')
[ "$version" == "1.9.2" ] && version=""
local full="$version$gemset"
[ "$full" != "" ] && echo "$full"
}
# Check http://github.com/Sirupsen/dotfiles for screenshot
PS1='\[$blue\]\W/\[$bold_blue\]$(rvm_version_prompt)\[$bold_green\]$(__git_ps1 " (%s)") \[${normal}\]$ '

View File

@ -1,9 +1,22 @@
PROMPT='\[${green}\]\u\[${normal}\]@\[${green}\]\h\[${normal}\]:\[${blue}\]\w\[${normal}\]\[${red}\]$(prompt_char)$(git_prompt_info)\[${normal}\]\$ '
# git themeing
GIT_THEME_PROMPT_DIRTY="×"
GIT_THEME_PROMPT_CLEAN="✓"
GIT_THEME_PROMPT_PREFIX=""
GIT_THEME_PROMPT_SUFFIX=""
# ${debian_chroot:+($debian_chroot)}
# scm themeing
SCM_THEME_PROMPT_DIRTY="×"
SCM_THEME_PROMPT_CLEAN="✓"
SCM_THEME_PROMPT_PREFIX=""
SCM_THEME_PROMPT_SUFFIX=""
# TODO: need a check for OS before adding this to the prompt
# ${debian_chroot:+($debian_chroot)}
#added TITLEBAR for updating the tab and window titles with the pwd
case $TERM in
xterm*)
TITLEBAR='\[\033]0;\w\007\]'
;;
*)
TITLEBAR=""
;;
esac

View File

@ -0,0 +1,20 @@
#!/bin/bash
# zitron theme by Florian Baumann <flo@noqqe.de>
## look-a-like
# user:host:pwd git-branch(*)$
# for example:
# noqqe:deathstar:themes master*$
PROMPT="${no_color}\u:\[\$(hostname)\]${normal}:${bold_yellow}\W/${normal} \[\$(git_prompt_info)\]${reset_color}$ "
## git-theme
# feel free to change git chars.
GIT_THEME_PROMPT_DIRTY="${bold_yellow}*${normal}"
GIT_THEME_PROMPT_CLEAN=""
GIT_THEME_PROMPT_PREFIX=""
GIT_THEME_PROMPT_SUFFIX=""
## ls colors
# thanks a lot to http://geoff.greer.fm/lscolors/
export LSCOLORS="Gxfxcxdxbxegedabagacad"
export LS_COLORS="no=00:fi=00:di=01;33:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;34:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:"