From b64c228da512350701af84f123241c46b694a00b Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Thu, 7 Oct 2010 17:15:14 -0700 Subject: [PATCH 001/126] Updates --- themes/bobby/bobby.theme.bash | 31 +++---- themes/colors.theme.bash | 150 +++++++++++++++++----------------- 2 files changed, 92 insertions(+), 89 deletions(-) diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index bea85eff..1ead4832 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -1,6 +1,20 @@ #!/bin/bash -# prompt themeing + +PROMPT="${bold_blue}\[\$(prompt_char)\]\[\$(git_prompt_info)\] ${orange}\h ${reset_color}in ${green}\w ${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}|" + +# GIT_THEME_PROMPT_DIRTY=" ✗" +# GIT_THEME_PROMPT_CLEAN=" ✓" +# GIT_THEME_PROMPT_PREFIX=" |" +# GIT_THEME_PROMPT_SUFFIX="|" + #added TITLEBAR for updating the tab and window titles with the pwd case $TERM in @@ -10,17 +24,4 @@ case $TERM in *) TITLEBAR="" ;; -esac -PROMPT="${TITLEBAR}${bold_blue}\$(prompt_char)\$(git_prompt_info) ${orange}\h ${reset_color}in ${green}\w ${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="|" +esac \ No newline at end of file diff --git a/themes/colors.theme.bash b/themes/colors.theme.bash index 1211f4bd..ae8f6166 100644 --- a/themes/colors.theme.bash +++ b/themes/colors.theme.bash @@ -1,79 +1,81 @@ #!/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' +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' + + + +# 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 # # -# 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="\[$ESC[m\]" +# reset_color="\[$ESC[${NON_BOLD};${FG_WHITE};${BG_NULL}m\]" # -# normal=$'\e[00m' -# reset_color=$'\e[39m' - - - -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\]" \ No newline at end of file +# +# +# # 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\]" \ No newline at end of file From 0cd8b40339de9e1d82c2fa4252aa3f79a71356da Mon Sep 17 00:00:00 2001 From: zerobearing2 Date: Thu, 7 Oct 2010 18:13:57 -0700 Subject: [PATCH 002/126] added alias to git plugin --- plugins/git.plugin.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git.plugin.bash b/plugins/git.plugin.bash index 909a90e5..148d490c 100644 --- a/plugins/git.plugin.bash +++ b/plugins/git.plugin.bash @@ -2,6 +2,7 @@ # Aliases alias g='git' +alias get='git' alias gst='git status' alias gs='git status' alias gl='git pull' From 45a50c099e5966794c4c1706cdc15cfdbb33c20d Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Sat, 9 Oct 2010 15:01:50 -0700 Subject: [PATCH 003/126] Updated the color themes. Added underline and background colors. --- themes/base.theme.bash | 12 ++-- themes/candy/candy.theme.bash | 2 +- themes/clean/clean.theme.bash | 2 +- themes/colors.theme.bash | 95 +++++++++-------------------- themes/simple/simple.theme.bash | 2 +- themes/standard/standard.theme.bash | 2 + 6 files changed, 40 insertions(+), 75 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 98d295ae..8e2e2eee 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -2,20 +2,20 @@ # 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 '○' + git branch >/dev/null 2>/dev/null && echo -e '±' && return + hg root >/dev/null 2>/dev/null && echo -e '☿' && return + echo -e '○' } function parse_git_dirty { if [[ -n $(git status -s 2> /dev/null) ]]; then - echo "$GIT_THEME_PROMPT_DIRTY" + echo -e "$GIT_THEME_PROMPT_DIRTY" else - echo "$GIT_THEME_PROMPT_CLEAN" + echo -e "$GIT_THEME_PROMPT_CLEAN" fi } function git_prompt_info() { 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 "$GIT_THEME_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$GIT_THEME_PROMPT_SUFFIX" } \ No newline at end of file diff --git a/themes/candy/candy.theme.bash b/themes/candy/candy.theme.bash index f2a5db2a..7158a9e7 100644 --- a/themes/candy/candy.theme.bash +++ b/themes/candy/candy.theme.bash @@ -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} ' \ No newline at end of file +PROMPT="${green}\u@\h ${blue}\T ${reset_color}${white}\w${reset_color}\[\$(git_prompt_info)\]${blue} →${bold_blue} \$${reset_color} " \ No newline at end of file diff --git a/themes/clean/clean.theme.bash b/themes/clean/clean.theme.bash index e84c2e06..88949fd0 100644 --- a/themes/clean/clean.theme.bash +++ b/themes/clean/clean.theme.bash @@ -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} \[\$(git_prompt_info)\]$ " RPROMPT='[\t]' diff --git a/themes/colors.theme.bash b/themes/colors.theme.bash index ae8f6166..9aa253f5 100644 --- a/themes/colors.theme.bash +++ b/themes/colors.theme.bash @@ -1,81 +1,44 @@ #!/bin/bash -green=$'\e[0;32m' -red=$'\e[0;31m' -blue=$'\e[0;34m' -white=$'\e[1;37m' 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_green=$'\e[1;32m' +bold_black=$'\e[1;30m' bold_red=$'\e[1;31m' -bold_blue=$'\e[1;34m' +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' + + normal=$'\e[00m' -reset_color=$'\e[39m' - - - -# 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\]" \ No newline at end of file +reset_color=$'\e[39m' \ No newline at end of file diff --git a/themes/simple/simple.theme.bash b/themes/simple/simple.theme.bash index be28af55..5a8d5d91 100644 --- a/themes/simple/simple.theme.bash +++ b/themes/simple/simple.theme.bash @@ -11,7 +11,7 @@ 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}\[\$(git_prompt_info)\]${reset_color} " # git themeing diff --git a/themes/standard/standard.theme.bash b/themes/standard/standard.theme.bash index ce997099..10caf7f9 100644 --- a/themes/standard/standard.theme.bash +++ b/themes/standard/standard.theme.bash @@ -1,5 +1,7 @@ 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="✓" From f1ead0535bccbbffcbd6792f51071f5cd6b97181 Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Sat, 9 Oct 2010 16:28:16 -0700 Subject: [PATCH 004/126] updated bobby theme --- themes/bobby/bobby.theme.bash | 6 ------ 1 file changed, 6 deletions(-) diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index 1ead4832..b9fa7aa5 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -3,18 +3,12 @@ PROMPT="${bold_blue}\[\$(prompt_char)\]\[\$(git_prompt_info)\] ${orange}\h ${reset_color}in ${green}\w ${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}|" -# GIT_THEME_PROMPT_DIRTY=" ✗" -# GIT_THEME_PROMPT_CLEAN=" ✓" -# GIT_THEME_PROMPT_PREFIX=" |" -# GIT_THEME_PROMPT_SUFFIX="|" - #added TITLEBAR for updating the tab and window titles with the pwd case $TERM in From 698509adb065226be60670560a5ad59edae1f05e Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Sat, 9 Oct 2010 21:46:28 -0700 Subject: [PATCH 005/126] Added rvm prompt info --- lib/aliases.bash | 3 +++ plugins/rvm.plugin.bash | 2 +- themes/base.theme.bash | 6 ++++++ themes/bobby/bobby.theme.bash | 5 ++++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/aliases.bash b/lib/aliases.bash index 49e89cea..76e1c1e1 100644 --- a/lib/aliases.bash +++ b/lib/aliases.bash @@ -17,6 +17,9 @@ 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 diff --git a/plugins/rvm.plugin.bash b/plugins/rvm.plugin.bash index 020bb3fa..d3c81ed4 100644 --- a/plugins/rvm.plugin.bash +++ b/plugins/rvm.plugin.bash @@ -13,4 +13,4 @@ rvm_default () { function rvm_version () { ruby --version -} +} \ No newline at end of file diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 8e2e2eee..d14e42b9 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -18,4 +18,10 @@ function parse_git_dirty { function git_prompt_info() { ref=$(git symbolic-ref HEAD 2> /dev/null) || return echo -e "$GIT_THEME_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$GIT_THEME_PROMPT_SUFFIX" +} + + +function rvm_version_prompt { + rvm=$(rvm tools identifier) || return + echo -e "$RVM_THEME_PROMPT_PREFIX$rvm$RVM_THEME_PROMPT_SUFFIX" } \ No newline at end of file diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index b9fa7aa5..a12c62d0 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -1,7 +1,7 @@ #!/bin/bash -PROMPT="${bold_blue}\[\$(prompt_char)\]\[\$(git_prompt_info)\] ${orange}\h ${reset_color}in ${green}\w ${reset_color}\[→ " +PROMPT="${bold_blue}\[\$(prompt_char)\]\[\$(git_prompt_info)\]${blue}\$(rvm_version_prompt) ${orange}\h ${reset_color}in ${green}\w ${reset_color}\[→ " # git theming GIT_THEME_PROMPT_DIRTY=" ${red}✗" @@ -9,6 +9,9 @@ GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓" GIT_THEME_PROMPT_PREFIX=" ${green}|" GIT_THEME_PROMPT_SUFFIX="${green}|" +RVM_THEME_PROMPT_PREFIX=" |" +RVM_THEME_PROMPT_SUFFIX="|" + #added TITLEBAR for updating the tab and window titles with the pwd case $TERM in From d0d58f3763c4a7baaf0c2bc653bea41f34aa7bed Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Sat, 9 Oct 2010 21:47:45 -0700 Subject: [PATCH 006/126] rvm goodness --- themes/bobby/bobby.theme.bash | 13 +------------ themes/standard/standard.theme.bash | 13 ++++++++++++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index a12c62d0..da54a933 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -10,15 +10,4 @@ GIT_THEME_PROMPT_PREFIX=" ${green}|" GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX=" |" -RVM_THEME_PROMPT_SUFFIX="|" - - -#added TITLEBAR for updating the tab and window titles with the pwd -case $TERM in - xterm*) - TITLEBAR='\[\033]0;\w\007\]' - ;; - *) - TITLEBAR="" - ;; -esac \ No newline at end of file +RVM_THEME_PROMPT_SUFFIX="|" \ No newline at end of file diff --git a/themes/standard/standard.theme.bash b/themes/standard/standard.theme.bash index 10caf7f9..61a9cbc3 100644 --- a/themes/standard/standard.theme.bash +++ b/themes/standard/standard.theme.bash @@ -8,4 +8,15 @@ GIT_THEME_PROMPT_CLEAN="✓" GIT_THEME_PROMPT_PREFIX="" GIT_THEME_PROMPT_SUFFIX="" -# ${debian_chroot:+($debian_chroot)} \ No newline at end of file +# 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 \ No newline at end of file From 4f3462b6d1633c07ba3d9d85176ec400b1d0a2e7 Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Sun, 10 Oct 2010 08:34:30 -0700 Subject: [PATCH 007/126] Added to gitignore .rvmrc --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 54f7202f..b9003bb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store custom/*.bash -!custom/example.bash \ No newline at end of file +!custom/example.bash +.rvmrc \ No newline at end of file From 2010f011f81adedc6f9fc932547f3089a30a957e Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Sun, 10 Oct 2010 09:24:19 -0700 Subject: [PATCH 008/126] 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. --- .gitignore | 5 +- README.md | 33 +++++++++---- aliases/emacs.aliases.bash | 3 ++ .../general.aliases.bash | 0 .../git.aliases.bash | 0 .../heroku.aliases.bash | 0 aliases/osx.aliases.bash | 17 +++++++ .../rails.aliases.bash | 0 .../textmate.aliases.bash | 0 aliases/vim.aliases.bash | 3 ++ bash_it.sh | 7 +-- functions/base.funtions.bash | 37 --------------- lib/history.bash | 1 - plugins/base.plugin.bash | 47 ++++++++++++++----- plugins/emacs.plugin.bash | 1 - .../git.plugins.bash | 0 plugins/hg.plugins.bash | 14 ++++++ .../javascript.plugins.bash | 0 .../nginx.plugins.bash | 0 plugins/osx.plugin.bash | 2 - plugins/vim.plugin.bash | 4 -- 21 files changed, 103 insertions(+), 71 deletions(-) create mode 100644 aliases/emacs.aliases.bash rename lib/aliases.bash => aliases/general.aliases.bash (100%) rename plugins/git.plugin.bash => aliases/git.aliases.bash (100%) rename plugins/heroku.plugin.bash => aliases/heroku.aliases.bash (100%) create mode 100644 aliases/osx.aliases.bash rename plugins/rails.plugin.bash => aliases/rails.aliases.bash (100%) rename plugins/textmate.plugin.bash => aliases/textmate.aliases.bash (100%) create mode 100644 aliases/vim.aliases.bash delete mode 100644 functions/base.funtions.bash delete mode 100644 plugins/emacs.plugin.bash rename functions/git.functions.bash => plugins/git.plugins.bash (100%) create mode 100644 plugins/hg.plugins.bash rename functions/javascript.functions.bash => plugins/javascript.plugins.bash (100%) rename functions/nginx.functions.bash => plugins/nginx.plugins.bash (100%) delete mode 100644 plugins/vim.plugin.bash diff --git a/.gitignore b/.gitignore index b9003bb1..bcddac3f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/README.md b/README.md index 2985cbfd..9578c43e 100644 --- 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 /template/bash_profile.template.bash ~/.bash_profile -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

 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!
+## 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.
\ No newline at end of file
+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
\ No newline at end of file
diff --git a/aliases/emacs.aliases.bash b/aliases/emacs.aliases.bash
new file mode 100644
index 00000000..792d737b
--- /dev/null
+++ b/aliases/emacs.aliases.bash
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+alias em="emacs"
\ No newline at end of file
diff --git a/lib/aliases.bash b/aliases/general.aliases.bash
similarity index 100%
rename from lib/aliases.bash
rename to aliases/general.aliases.bash
diff --git a/plugins/git.plugin.bash b/aliases/git.aliases.bash
similarity index 100%
rename from plugins/git.plugin.bash
rename to aliases/git.aliases.bash
diff --git a/plugins/heroku.plugin.bash b/aliases/heroku.aliases.bash
similarity index 100%
rename from plugins/heroku.plugin.bash
rename to aliases/heroku.aliases.bash
diff --git a/aliases/osx.aliases.bash b/aliases/osx.aliases.bash
new file mode 100644
index 00000000..8d6b2d8c
--- /dev/null
+++ b/aliases/osx.aliases.bash
@@ -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/plugins/rails.plugin.bash b/aliases/rails.aliases.bash
similarity index 100%
rename from plugins/rails.plugin.bash
rename to aliases/rails.aliases.bash
diff --git a/plugins/textmate.plugin.bash b/aliases/textmate.aliases.bash
similarity index 100%
rename from plugins/textmate.plugin.bash
rename to aliases/textmate.aliases.bash
diff --git a/aliases/vim.aliases.bash b/aliases/vim.aliases.bash
new file mode 100644
index 00000000..d1025755
--- /dev/null
+++ b/aliases/vim.aliases.bash
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+alias v='mvim --remote-tab'
\ No newline at end of file
diff --git a/bash_it.sh b/bash_it.sh
index b5880596..c13b3093 100644
--- a/bash_it.sh
+++ b/bash_it.sh
@@ -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
index d1f467d1..00000000
--- a/functions/base.funtions.bash
+++ /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
diff --git a/lib/history.bash b/lib/history.bash
index c7dcaa66..c0f60f24 100644
--- a/lib/history.bash
+++ b/lib/history.bash
@@ -13,7 +13,6 @@ export HISTCONTROL=erasedups
 # resize history size
 export HISTSIZE=5000
 
-
 export AUTOFEATURE=true autotest
 
 function rh {
diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash
index 4984df86..931bb413 100644
--- a/plugins/base.plugin.bash
+++ b/plugins/base.plugin.bash
@@ -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"
+# 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}"
+}
 
 
-if [ -s /usr/bin/firefox ] ; then
-  unalias firefox
-fi
\ No newline at end of file
+# 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
index fc9d0bfe..00000000
--- a/plugins/emacs.plugin.bash
+++ /dev/null
@@ -1 +0,0 @@
-alias em="emacs"
\ No newline at end of file
diff --git a/functions/git.functions.bash b/plugins/git.plugins.bash
similarity index 100%
rename from functions/git.functions.bash
rename to plugins/git.plugins.bash
diff --git a/plugins/hg.plugins.bash b/plugins/hg.plugins.bash
new file mode 100644
index 00000000..f72761b9
--- /dev/null
+++ b/plugins/hg.plugins.bash
@@ -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
diff --git a/functions/javascript.functions.bash b/plugins/javascript.plugins.bash
similarity index 100%
rename from functions/javascript.functions.bash
rename to plugins/javascript.plugins.bash
diff --git a/functions/nginx.functions.bash b/plugins/nginx.plugins.bash
similarity index 100%
rename from functions/nginx.functions.bash
rename to plugins/nginx.plugins.bash
diff --git a/plugins/osx.plugin.bash b/plugins/osx.plugin.bash
index 1dd9266d..c366b3f6 100644
--- a/plugins/osx.plugin.bash
+++ b/plugins/osx.plugin.bash
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-alias f='open -a Finder '
-
 function tab() {
   osascript 2>/dev/null <
Date: Sun, 10 Oct 2010 09:28:59 -0700
Subject: [PATCH 009/126] Updated REAME.

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 9578c43e..f054ccbf 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
 
 '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. :) 
 
-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
 

From 22d9179ff7eb9d0919bb5d22c01dc9f80eb384ff Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Sun, 10 Oct 2010 09:45:32 -0700
Subject: [PATCH 010/126] Add "add_ssh" to add a new ssh host to the
 ~/.ssh/config file.

---
 aliases/git.aliases.bash | 2 ++
 plugins/ssh.plugins.bash | 5 +++++
 2 files changed, 7 insertions(+)
 create mode 100644 plugins/ssh.plugins.bash

diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash
index 148d490c..6c23df8c 100644
--- a/aliases/git.aliases.bash
+++ b/aliases/git.aliases.bash
@@ -1,6 +1,8 @@
 #!/bin/bash
 
 # Aliases
+alias ga='git add'
+alias gall='git add .'
 alias g='git'
 alias get='git'
 alias gst='git status'
diff --git a/plugins/ssh.plugins.bash b/plugins/ssh.plugins.bash
new file mode 100644
index 00000000..504e2231
--- /dev/null
+++ b/plugins/ssh.plugins.bash
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+function add_ssh() {
+  echo -en "\n\nHost $1\n  HostName $2\n  User $3" >> ~/.ssh/config
+}
\ No newline at end of file

From b4257a46db828089f856add514f54f61eec4bcfd Mon Sep 17 00:00:00 2001
From: Sirupsen 
Date: Sun, 10 Oct 2010 20:05:03 +0200
Subject: [PATCH 011/126] Added "sirup" theme.

---
 themes/sirup/sirup.theme.bash | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 themes/sirup/sirup.theme.bash

diff --git a/themes/sirup/sirup.theme.bash b/themes/sirup/sirup.theme.bash
new file mode 100644
index 00000000..50665871
--- /dev/null
+++ b/themes/sirup/sirup.theme.bash
@@ -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}\]$ '

From e1c063ff0aa495452fc4798c7dea900eaf8c07b2 Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Sun, 10 Oct 2010 17:54:11 -0700
Subject: [PATCH 012/126] Updated the ssh config

---
 plugins/ssh.plugins.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/ssh.plugins.bash b/plugins/ssh.plugins.bash
index 504e2231..872d1114 100644
--- a/plugins/ssh.plugins.bash
+++ b/plugins/ssh.plugins.bash
@@ -1,5 +1,5 @@
 #!/bin/bash
 
 function add_ssh() {
-  echo -en "\n\nHost $1\n  HostName $2\n  User $3" >> ~/.ssh/config
+  echo -en "\n\nHost $1\n  HostName $2\n  User $3\n  ServerAliveInterval 30\n  ServerAliveCountMax 120" >> ~/.ssh/config
 }
\ No newline at end of file

From 69c33baa7ae6a8da4c14552f9f4ef40e2cc9d36c Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Sun, 10 Oct 2010 17:57:46 -0700
Subject: [PATCH 013/126] Added contributor to the readme.

---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index f054ccbf..4e037939 100644
--- a/README.md
+++ b/README.md
@@ -53,4 +53,5 @@ If you are submitting a pull request, please add your name to the list.
 * Robert Evans
 * David Bradford
 * Rich Manalang
-* Piotr Usewicz
\ No newline at end of file
+* Piotr Usewicz
+* Simon H. Eskildsen
\ No newline at end of file

From d76518de787def745e8b62003b09383767bdc967 Mon Sep 17 00:00:00 2001
From: Piotr Usewicz 
Date: Mon, 11 Oct 2010 14:01:32 +0100
Subject: [PATCH 014/126] Added Pete theme

---
 themes/pete/pete.theme.bash | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 themes/pete/pete.theme.bash

diff --git a/themes/pete/pete.theme.bash b/themes/pete/pete.theme.bash
new file mode 100644
index 00000000..27397dc2
--- /dev/null
+++ b/themes/pete/pete.theme.bash
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# prompt themeing
+PROMPT="(\t) \$(prompt_char) [\[$bold_blue\]\u\[$white\]@\[$green\]\h\[$white\]] \[$bold_yellow\]\w\[$white\]\$(git_prompt_info)\$(rvm_version_prompt) \\$\[$reset_color\] "
+
+GIT_THEME_PROMPT_DIRTY=" ✗"
+GIT_THEME_PROMPT_CLEAN=" ✓"
+GIT_THEME_PROMPT_PREFIX=" ("
+GIT_THEME_PROMPT_SUFFIX=")"
+RVM_THEME_PROMPT_PREFIX=" ("
+RVM_THEME_PROMPT_SUFFIX=")"

From bdc9ddbdd68ba43a4887bb703f59e58065425ad4 Mon Sep 17 00:00:00 2001
From: Piotr Usewicz 
Date: Mon, 11 Oct 2010 14:25:31 +0100
Subject: [PATCH 015/126] Fix clearing the color

---
 themes/pete/pete.theme.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/pete/pete.theme.bash b/themes/pete/pete.theme.bash
index 27397dc2..3186d9b7 100644
--- a/themes/pete/pete.theme.bash
+++ b/themes/pete/pete.theme.bash
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # prompt themeing
-PROMPT="(\t) \$(prompt_char) [\[$bold_blue\]\u\[$white\]@\[$green\]\h\[$white\]] \[$bold_yellow\]\w\[$white\]\$(git_prompt_info)\$(rvm_version_prompt) \\$\[$reset_color\] "
+PROMPT="(\t) \$(prompt_char) [\[$blue\]\u\[$normal_color\]@\[$green\]\h\[$reset_color\]] \[$yellow\]\w\[$reset_color\]\$(git_prompt_info)\$(rvm_version_prompt) \$\[$reset_color\] "
 
 GIT_THEME_PROMPT_DIRTY=" ✗"
 GIT_THEME_PROMPT_CLEAN=" ✓"

From 56a14b27cb38fe38b87321825f140fa28bab1c2d Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Mon, 11 Oct 2010 20:43:53 -0500
Subject: [PATCH 016/126] Added osx aliases for chrome and chromium

---
 aliases/osx.aliases.bash | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/aliases/osx.aliases.bash b/aliases/osx.aliases.bash
index 8d6b2d8c..cb842dae 100644
--- a/aliases/osx.aliases.bash
+++ b/aliases/osx.aliases.bash
@@ -8,6 +8,8 @@ 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 chrome"
+alias chromium="open -a chromium"
 alias dashcode="open -a dashcode"
 alias f='open -a Finder '
 

From c6c78752ff2dec4398da64b636dd2ec00ba99c68 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Mon, 11 Oct 2010 20:47:16 -0500
Subject: [PATCH 017/126] Added myself to README.md (Mark Szymanski)

---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 4e037939..dc90d5fd 100644
--- a/README.md
+++ b/README.md
@@ -54,4 +54,5 @@ If you are submitting a pull request, please add your name to the list.
 * David Bradford
 * Rich Manalang
 * Piotr Usewicz
-* Simon H. Eskildsen
\ No newline at end of file
+* Simon H. Eskildsen
+* Mark Szymanski

From a3ccf49d67e0e62281a1448d2cc73ce9b6cfa240 Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Tue, 12 Oct 2010 08:27:04 -0700
Subject: [PATCH 018/126] Added an extra comment to the bash profile template

---
 template/bash_profile.template.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash
index 0991d90c..f6c9d5d4 100644
--- a/template/bash_profile.template.bash
+++ b/template/bash_profile.template.bash
@@ -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

From b110de49b9caf8ba8850e870dd1550684b43ac26 Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Tue, 12 Oct 2010 08:37:17 -0700
Subject: [PATCH 019/126] Added another alias for git.

---
 aliases/git.aliases.bash | 1 +
 1 file changed, 1 insertion(+)

diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash
index 6c23df8c..abeb72ce 100644
--- a/aliases/git.aliases.bash
+++ b/aliases/git.aliases.bash
@@ -10,6 +10,7 @@ alias gs='git status'
 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'

From 50b19d8bef6cad2daa0ede1912557d72064cc9a9 Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Tue, 12 Oct 2010 10:11:21 -0700
Subject: [PATCH 020/126] Added sshosts to view all the ssh config hosts that
 have been added. This command will only print out the host names that you
 would use for ssh/scp.

---
 plugins/ssh.plugins.bash | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plugins/ssh.plugins.bash b/plugins/ssh.plugins.bash
index 872d1114..d771b3f9 100644
--- a/plugins/ssh.plugins.bash
+++ b/plugins/ssh.plugins.bash
@@ -2,4 +2,8 @@
 
 function add_ssh() {
   echo -en "\n\nHost $1\n  HostName $2\n  User $3\n  ServerAliveInterval 30\n  ServerAliveCountMax 120" >> ~/.ssh/config
+}
+
+function sshosts() {
+  awk '$1 ~ /Host$/ { print $2 }' ~/.ssh/config
 }
\ No newline at end of file

From 6f3498465acabb76e5b3333b8d2a401b3e55dd74 Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Tue, 12 Oct 2010 14:12:46 -0700
Subject: [PATCH 021/126] added new emacs alias

---
 aliases/emacs.aliases.bash | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/aliases/emacs.aliases.bash b/aliases/emacs.aliases.bash
index 792d737b..8115f163 100644
--- a/aliases/emacs.aliases.bash
+++ b/aliases/emacs.aliases.bash
@@ -1,3 +1,4 @@
 #!/bin/bash
 
-alias em="emacs"
\ No newline at end of file
+alias em="emacs"
+alias emac="open -a emacs"
\ No newline at end of file

From 79e50296d72060be8966e0d62d730cd8d66f00aa Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Tue, 12 Oct 2010 14:14:20 -0700
Subject: [PATCH 022/126] updated comment

---
 bash_it.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bash_it.sh b/bash_it.sh
index c13b3093..94f9952c 100644
--- a/bash_it.sh
+++ b/bash_it.sh
@@ -4,7 +4,7 @@
 # Reload Library
 alias reload='source ~/.bash_profile'
 
-# Load all files
+# Load the framework
 
 # Themes
 THEMES="${BASH}/themes/*.bash"

From a3dcbefa5fc34a5404c13e4855f7bd24d3aab6d3 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Tue, 12 Oct 2010 17:34:00 -0500
Subject: [PATCH 023/126] Added minimal theme

---
 themes/minimal/minimal.theme.bash | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 themes/minimal/minimal.theme.bash

diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash
new file mode 100644
index 00000000..96d0a8b9
--- /dev/null
+++ b/themes/minimal/minimal.theme.bash
@@ -0,0 +1,9 @@
+prompt_setter() {
+	if [[ $? -eq 0 ]]; then
+		PS1="\W "
+	else
+		PS1="${red}\W ${reset_color}"
+	fi
+}
+
+PROMPT_COMMAND=prompt_setter

From df20afc275bd5c48bb1de09e672a68beca455e1a Mon Sep 17 00:00:00 2001
From: Piotr Usewicz 
Date: Wed, 13 Oct 2010 11:24:10 +0100
Subject: [PATCH 024/126] Add history saving for prompt

---
 themes/pete/pete.theme.bash | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/themes/pete/pete.theme.bash b/themes/pete/pete.theme.bash
index 3186d9b7..1f9b4fc9 100644
--- a/themes/pete/pete.theme.bash
+++ b/themes/pete/pete.theme.bash
@@ -1,7 +1,16 @@
 #!/bin/bash
 
-# prompt themeing
-PROMPT="(\t) \$(prompt_char) [\[$blue\]\u\[$normal_color\]@\[$green\]\h\[$reset_color\]] \[$yellow\]\w\[$reset_color\]\$(git_prompt_info)\$(rvm_version_prompt) \$\[$reset_color\] "
+prompt_setter() {
+  # Save history
+  history -a
+  history -c
+  history -r
+  PS1="(\t) $(prompt_char) [\[$blue\]\u\[$reset_color\]@\[$green\]\H\[$reset_color\]] \[$yellow\]\w\[$reset_color\]$(git_prompt_info)$(rvm_version_prompt) $\[$reset_color\] "
+  PS2='> '
+  PS4='+ '
+}
+
+PROMPT_COMMAND=prompt_setter
 
 GIT_THEME_PROMPT_DIRTY=" ✗"
 GIT_THEME_PROMPT_CLEAN=" ✓"

From e2505ee022a9cb61cf07f6c4b8b1db22150bf6ea Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Wed, 13 Oct 2010 08:45:12 -0700
Subject: [PATCH 025/126] Added another git alias

---
 aliases/git.aliases.bash | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash
index abeb72ce..c9bb66c2 100644
--- a/aliases/git.aliases.bash
+++ b/aliases/git.aliases.bash
@@ -20,6 +20,7 @@ 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'
 
 case $OSTYPE in
   linux*)
@@ -53,5 +54,7 @@ function git-help() {
   echo "  gcp     = git cherry-pick"
   echo "  gco     = git checkout"
   echo "  gexport = git git archive --format zip --output"
+	echo "  gdel    = git branch -D"
+	echo "  gpo     = git push origin"
   echo 
 }
\ No newline at end of file

From b8ce9e629cbbfa7906416db5a65ec2d36e9dc6e1 Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Thu, 14 Oct 2010 09:10:26 -0700
Subject: [PATCH 026/126] Added a check to see if rvm is installed

---
 themes/base.theme.bash | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/themes/base.theme.bash b/themes/base.theme.bash
index d14e42b9..30fa5393 100644
--- a/themes/base.theme.bash
+++ b/themes/base.theme.bash
@@ -22,6 +22,8 @@ function git_prompt_info() {
 
 
 function rvm_version_prompt {
-  rvm=$(rvm tools identifier) || return
-  echo -e "$RVM_THEME_PROMPT_PREFIX$rvm$RVM_THEME_PROMPT_SUFFIX"
+  if which rvm &> /dev/null; then
+    rvm=$(rvm tools identifier) || return
+    echo -e "$RVM_THEME_PROMPT_PREFIX$rvm$RVM_THEME_PROMPT_SUFFIX"
+  fi
 }
\ No newline at end of file

From 686ac9c75657ea56fe728785494a656a08dd3570 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Thu, 14 Oct 2010 14:50:06 -0500
Subject: [PATCH 027/126] Added documentation for added git aliases (get, ga,
 and gall)

---
 aliases/git.aliases.bash | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash
index c9bb66c2..92342c83 100644
--- a/aliases/git.aliases.bash
+++ b/aliases/git.aliases.bash
@@ -40,6 +40,9 @@ function git-help() {
   echo "Git Custom Aliases Usage"
   echo 
   echo "  g       = git"
+  echo "  get 	  = git"
+  echo "  ga      = git add"
+  echo "  giall	  = git add ."
   echo "  gst/gs  = git status"
   echo "  gl      = git pull"
   echo "  gup     = git fetch && git rebase"
@@ -57,4 +60,4 @@ function git-help() {
 	echo "  gdel    = git branch -D"
 	echo "  gpo     = git push origin"
   echo 
-}
\ No newline at end of file
+}

From 13abb34b643725b033e5631417b3e78649cb128f Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Thu, 14 Oct 2010 14:50:58 -0500
Subject: [PATCH 028/126] Fixed typo

---
 aliases/git.aliases.bash | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash
index 92342c83..f0a99fe3 100644
--- a/aliases/git.aliases.bash
+++ b/aliases/git.aliases.bash
@@ -38,11 +38,11 @@ esac
 
 function git-help() {
   echo "Git Custom Aliases Usage"
-  echo 
+  echo
   echo "  g       = git"
   echo "  get 	  = git"
   echo "  ga      = git add"
-  echo "  giall	  = git add ."
+  echo "  gall	  = git add ."
   echo "  gst/gs  = git status"
   echo "  gl      = git pull"
   echo "  gup     = git fetch && git rebase"
@@ -59,5 +59,5 @@ function git-help() {
   echo "  gexport = git git archive --format zip --output"
 	echo "  gdel    = git branch -D"
 	echo "  gpo     = git push origin"
-  echo 
+  echo
 }

From 468c0c5ce9ba8eeb41dc9bd026ed3751b3eeeb3f Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Thu, 14 Oct 2010 15:11:02 -0700
Subject: [PATCH 029/126] Merged in mrman208's additions.

---
 plugins/ssh.plugins.bash | 2 +-
 themes/base.theme.bash   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/ssh.plugins.bash b/plugins/ssh.plugins.bash
index d771b3f9..0e50199b 100644
--- a/plugins/ssh.plugins.bash
+++ b/plugins/ssh.plugins.bash
@@ -4,6 +4,6 @@ function add_ssh() {
   echo -en "\n\nHost $1\n  HostName $2\n  User $3\n  ServerAliveInterval 30\n  ServerAliveCountMax 120" >> ~/.ssh/config
 }
 
-function sshosts() {
+function sshlist() {
   awk '$1 ~ /Host$/ { print $2 }' ~/.ssh/config
 }
\ No newline at end of file
diff --git a/themes/base.theme.bash b/themes/base.theme.bash
index 30fa5393..f898875b 100644
--- a/themes/base.theme.bash
+++ b/themes/base.theme.bash
@@ -21,7 +21,7 @@ function git_prompt_info() {
 }
 
 
-function rvm_version_prompt {
+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"

From bc225b8a3181d8bf8e0592975e606d5099d27172 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Thu, 14 Oct 2010 21:50:02 -0500
Subject: [PATCH 030/126] Added links to each contributor's GitHub profile.

---
 README.md | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index dc90d5fd..f889adb5 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # 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. :)
 
 Includes some autocompletion tools, theming support, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
 
@@ -33,7 +33,7 @@ For custom scripts, and aliases, you can create the following files and they wil
 * lib/custom.bash
 * plugins/custom.plugins.bash
 
-and anything in the custom directory will be ignored with the exception of custom/example.bash. 
+and anything in the custom directory will be ignored with the exception of custom/example.bash.
 
 ## Themes
 
@@ -50,9 +50,17 @@ So, if you have contributions to bash-it, please send me a pull request and I'll
 
 If you are submitting a pull request, please add your name to the list.
 
-* Robert Evans
-* David Bradford
-* Rich Manalang
-* Piotr Usewicz
-* Simon H. Eskildsen
-* Mark Szymanski
+* [Robert Evans][revans]
+* [David Bradford][zerobearing2]
+* [Rich Manalang][manalang]
+* [Piotr Usewicz][pusewicz]
+* [Simon H. Eskildsen][sirupsen]
+* [Mark Szymanski][mrman208]
+
+[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
+

From 3737f052ff2b30ef040d5f31ffd257cf4c6f6165 Mon Sep 17 00:00:00 2001
From: Robert R Evans 
Date: Fri, 15 Oct 2010 08:11:54 -0700
Subject: [PATCH 031/126] Started adding mercurial aliases.

---
 aliases/hg.aliases.bash | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 aliases/hg.aliases.bash

diff --git a/aliases/hg.aliases.bash b/aliases/hg.aliases.bash
new file mode 100644
index 00000000..64f20f57
--- /dev/null
+++ b/aliases/hg.aliases.bash
@@ -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
+}
\ No newline at end of file

From 479bdf200090246b2d7cf4dc44232c151414672e Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Fri, 15 Oct 2010 22:20:43 -0500
Subject: [PATCH 032/126] Added alias for 'git clone' (gcl)

---
 aliases/git.aliases.bash | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash
index f0a99fe3..476ef086 100644
--- a/aliases/git.aliases.bash
+++ b/aliases/git.aliases.bash
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 # Aliases
+alias gcl='git clone'
 alias ga='git add'
 alias gall='git add .'
 alias g='git'
@@ -39,6 +40,7 @@ esac
 function git-help() {
   echo "Git Custom Aliases Usage"
   echo
+  echo "  gcl	  = git clone"
   echo "  g       = git"
   echo "  get 	  = git"
   echo "  ga      = git add"

From a792e400cc2ba480c5f1e609330b4e12eb45a21b Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Sun, 17 Oct 2010 09:57:06 -0500
Subject: [PATCH 033/126] Small tweak to minimal theme, made the red PS1 text
 bold.

---
 themes/minimal/minimal.theme.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash
index 96d0a8b9..a30c6293 100644
--- a/themes/minimal/minimal.theme.bash
+++ b/themes/minimal/minimal.theme.bash
@@ -2,7 +2,7 @@ prompt_setter() {
 	if [[ $? -eq 0 ]]; then
 		PS1="\W "
 	else
-		PS1="${red}\W ${reset_color}"
+		PS1="${bold_red}\W ${reset_color}"
 	fi
 }
 

From 46ba431f2ac04bfe83b05426cd7a4aa889197186 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Sun, 17 Oct 2010 10:01:15 -0500
Subject: [PATCH 034/126] Fixed chrome alias for Mac OS X

---
 aliases/osx.aliases.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aliases/osx.aliases.bash b/aliases/osx.aliases.bash
index cb842dae..542b927a 100644
--- a/aliases/osx.aliases.bash
+++ b/aliases/osx.aliases.bash
@@ -8,7 +8,7 @@ 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 chrome"
+alias chrome="open -a google\ chrome"
 alias chromium="open -a chromium"
 alias dashcode="open -a dashcode"
 alias f='open -a Finder '

From da4b526c596f99df54a5a6328adc84ce082ad972 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Sun, 17 Oct 2010 14:36:30 -0500
Subject: [PATCH 035/126] Fixed bug where everything was bolded after failed
 command

---
 themes/minimal/minimal.theme.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash
index a30c6293..e70165d2 100644
--- a/themes/minimal/minimal.theme.bash
+++ b/themes/minimal/minimal.theme.bash
@@ -2,7 +2,7 @@ prompt_setter() {
 	if [[ $? -eq 0 ]]; then
 		PS1="\W "
 	else
-		PS1="${bold_red}\W ${reset_color}"
+		PS1="${bold_red}\W ${normal}"
 	fi
 }
 

From af3c57147300878e92f34a003f28f0b4aa95fc2f Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Sun, 17 Oct 2010 20:32:05 -0500
Subject: [PATCH 036/126] Added mkcd alias, creates a directory and
 automatically cd's into it

---
 aliases/general.aliases.bash | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash
index 76e1c1e1..f26b5a20 100644
--- a/aliases/general.aliases.bash
+++ b/aliases/general.aliases.bash
@@ -25,6 +25,11 @@ alias	md='mkdir -p'
 alias	rd=rmdir
 alias d='dirs -v'
 
+function mkcd(){
+	mkdir $*
+	cd $*
+}
+
 function aliases-help() {
   echo "Generic Alias Usage"
   echo
@@ -42,4 +47,4 @@ function aliases-help() {
   echo "  rd    = rmdir"
   echo "  d     = dirs -v"
   echo 
-}
\ No newline at end of file
+}

From 39248d498af250eed919f7f45dd91a31ede04dcd Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Sun, 17 Oct 2010 20:34:16 -0500
Subject: [PATCH 037/126] Added ex alias to exit

---
 aliases/general.aliases.bash | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash
index f26b5a20..8cf27d16 100644
--- a/aliases/general.aliases.bash
+++ b/aliases/general.aliases.bash
@@ -10,6 +10,8 @@ alias l='ls -a'
 alias c='clear'
 alias k='clear'
 
+alias ex="exit"
+
 alias ..='cd ..'        # Go up one directory
 alias ...='cd ../..'    # Go up two directories
 alias -- -="cd -"       # Go back

From 45c1cb9cc275518b912e98ae22eed315102f40a3 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Sun, 17 Oct 2010 21:16:14 -0500
Subject: [PATCH 038/126] Fixed problem that could have occured in the mkdcd
 command with directories containing spaces

---
 aliases/general.aliases.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash
index 8cf27d16..f401a8db 100644
--- a/aliases/general.aliases.bash
+++ b/aliases/general.aliases.bash
@@ -28,8 +28,8 @@ alias	rd=rmdir
 alias d='dirs -v'
 
 function mkcd(){
-	mkdir $*
-	cd $*
+	mkdir -p "$*"
+	cd "$*"
 }
 
 function aliases-help() {

From 123c3be6986a3f731aff9458c59aff1745343d60 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Mon, 18 Oct 2010 18:24:15 -0500
Subject: [PATCH 039/126] Moved mkcd function from aliases/general.aliases.bash
 to plugins/base.plugins.bash

---
 aliases/general.aliases.bash | 5 -----
 plugins/base.plugin.bash     | 6 +++++-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash
index f401a8db..4cd000ca 100644
--- a/aliases/general.aliases.bash
+++ b/aliases/general.aliases.bash
@@ -27,11 +27,6 @@ alias	md='mkdir -p'
 alias	rd=rmdir
 alias d='dirs -v'
 
-function mkcd(){
-	mkdir -p "$*"
-	cd "$*"
-}
-
 function aliases-help() {
   echo "Generic Alias Usage"
   echo
diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash
index 931bb413..2d780287 100644
--- a/plugins/base.plugin.bash
+++ b/plugins/base.plugin.bash
@@ -11,6 +11,10 @@ function myip {
   echo "Your public IP is: ${bold_green} $res ${normal}"
 }
 
+function mkcd(){
+	mkdir -p "$*"
+	cd "$*"
+}
 
 # View man documentation in Preview
 pman () {
@@ -36,4 +40,4 @@ usage ()
   else
     du -hd 1
   fi
-}
\ No newline at end of file
+}

From 0463117e52169bff6afa5d26bcf752bfa239f9c9 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Mon, 18 Oct 2010 21:08:55 -0500
Subject: [PATCH 040/126] Added alias piano="pianobar" to general.aliases.bash.

---
 aliases/general.aliases.bash | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash
index 4cd000ca..c09ddffe 100644
--- a/aliases/general.aliases.bash
+++ b/aliases/general.aliases.bash
@@ -12,6 +12,10 @@ alias k='clear'
 
 alias ex="exit"
 
+# 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

From 6360f474097202905749ff48187d02b06982d608 Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Tue, 19 Oct 2010 15:49:57 -0500
Subject: [PATCH 041/126] Changed ex alias for exit to q, turns ex is the
 command for entering vim's ex mode.

---
 aliases/general.aliases.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash
index c09ddffe..d9041ebf 100644
--- a/aliases/general.aliases.bash
+++ b/aliases/general.aliases.bash
@@ -10,7 +10,7 @@ alias l='ls -a'
 alias c='clear'
 alias k='clear'
 
-alias ex="exit"
+alias q="exit"
 
 # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/
 

From b4a85906e5887ba36f0e248c31b9dac33fe1d43f Mon Sep 17 00:00:00 2001
From: Mark Szymanski 
Date: Wed, 20 Oct 2010 17:41:08 -0500
Subject: [PATCH 042/126] Some minor formatting changes to README

---
 README.md | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md
index f889adb5..35217e74 100644
--- a/README.md
+++ b/README.md
@@ -6,32 +6,28 @@ Includes some autocompletion tools, theming support, aliases, custom functions,
 
 ## 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.
 
-

-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 /template/bash_profile.template.bash ~/.bash_profile
+	cp ~/.bash_profile ~/.bash_profile_original
+	cp /template/bash_profile.template.bash ~/.bash_profile
 
-
## Help Screens -

-bash-it (will show all the help commands)
-aliases-help
-rails-help
-git-help
-
+ bash-it (will show all the help commands) + aliases-help + rails-help + git-help ## Your Custom scripts, aliases, and functions 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 +* `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. From f1f12d2da0a1ec5b771898dffd1d50114f500c08 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Wed, 20 Oct 2010 17:42:02 -0500 Subject: [PATCH 043/126] Added another formatting change I overlooked --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 35217e74..faeb5d3d 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ For custom scripts, and aliases, you can create the following files and they wil * `lib/custom.bash` * `plugins/custom.plugins.bash` -and anything in the custom directory will be ignored with the exception of custom/example.bash. +and anything in the custom directory will be ignored with the exception of `custom/example.bash`. ## Themes From e7dd619ba649624987a0073d826c261650252bd4 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Thu, 21 Oct 2010 16:18:05 -0500 Subject: [PATCH 044/126] Added editor and pager alias to open your $EDITOR or $PAGER, respectively. --- aliases/general.aliases.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index d9041ebf..1d43d451 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -10,6 +10,9 @@ alias l='ls -a' alias c='clear' alias k='clear' +alias editor="$EDITOR" +alias pager="$PAGER" + alias q="exit" # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ From 7aa791e2d6a161e57d6fc2b2e445d1dc5fc7088d Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Thu, 21 Oct 2010 15:06:32 -0700 Subject: [PATCH 045/126] Improved the wrapping of the bobby theme --- themes/bobby/bobby.theme.bash | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index da54a933..8eb50c54 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -1,7 +1,6 @@ #!/bin/bash - -PROMPT="${bold_blue}\[\$(prompt_char)\]\[\$(git_prompt_info)\]${blue}\$(rvm_version_prompt) ${orange}\h ${reset_color}in ${green}\w ${reset_color}\[→ " +PROMPT="\[${bold_blue}\]\[\$(prompt_char)\]\[\$(git_prompt_info)\]\[${blue}\]\[\$(rvm_version_prompt) \]\[${orange}\]\h \[${reset_color}\]in \[${green}\]\w \[${reset_color}\]\[→ " # git theming GIT_THEME_PROMPT_DIRTY=" ${red}✗" @@ -10,4 +9,4 @@ GIT_THEME_PROMPT_PREFIX=" ${green}|" GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX=" |" -RVM_THEME_PROMPT_SUFFIX="|" \ No newline at end of file +RVM_THEME_PROMPT_SUFFIX="|" From c92a5f23f3161f84bc44fd27240634fc47c81437 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 23 Oct 2010 10:57:31 -0500 Subject: [PATCH 046/126] Added jekyll aliases --- aliases/jekyll.aliases.bash | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 aliases/jekyll.aliases.bash diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash new file mode 100644 index 00000000..249bca16 --- /dev/null +++ b/aliases/jekyll.aliases.bash @@ -0,0 +1,19 @@ +# Open the root of your site in your favorite editor + +alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." + +# Open the _posts/ directory for making a new blog post (seperate from above alias because not everyone uses jekyll for a blog) + +alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." + +# Build and locally serve the site + +alias testsite="cd $JEKYLL_LOCAL_ROOT && jekyll --server --auto" + +# Build but don't locally serve the site + +alias buildsite="cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" + +# Rsync the site to the remote server + +alias deploysite="cd $JEKYLL_LOCAL_ROOT %% rsync -rz _site/ $JEKYLL_REMOTE_ROOT" From 96ccdaee51e9b40fc4427f1fc14a9cfe4b4e871a Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 23 Oct 2010 10:58:44 -0500 Subject: [PATCH 047/126] Added some variables that the jekyll aliases need --- template/bash_profile.template.bash | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index f6c9d5d4..f46d71db 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -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,13 @@ 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="~/Sites/mrminimalist" + +# And change this to the remote server and root + +export JEKYLL_REMOTE_ROOT="user@server:/path/to/jekyll/root" + # Load Bash It source $BASH/bash_it.sh From 21820276fb8546d63828e05370b6545f2b24fa07 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 23 Oct 2010 11:10:37 -0500 Subject: [PATCH 048/126] Fixed a stupid mistake in using percent signs instead of ampersands --- aliases/jekyll.aliases.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index 249bca16..a3e3fc05 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -16,4 +16,4 @@ alias buildsite="cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" # Rsync the site to the remote server -alias deploysite="cd $JEKYLL_LOCAL_ROOT %% rsync -rz _site/ $JEKYLL_REMOTE_ROOT" +alias deploysite="cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT" From 5ec52df28a068cc958f91f927f2a9e81f281eac4 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 24 Oct 2010 08:57:01 -0500 Subject: [PATCH 049/126] Added git alias: gss=git status -s --- aliases/git.aliases.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash index 476ef086..40d87802 100644 --- a/aliases/git.aliases.bash +++ b/aliases/git.aliases.bash @@ -8,6 +8,7 @@ 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' @@ -46,6 +47,7 @@ function git-help() { 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" From a308e771e5471286599b4402a60b469b0e8950d9 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 25 Oct 2010 08:44:47 -0500 Subject: [PATCH 050/126] Added l1 alias for ls -1 --- aliases/general.aliases.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index 1d43d451..ebec1bda 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -6,6 +6,7 @@ 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' alias c='clear' alias k='clear' From af2d6bb7a9a96e92f623247f8349e3b85cffa403 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 25 Oct 2010 08:45:52 -0500 Subject: [PATCH 051/126] Added ignore directive for vim swap files --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bcddac3f..fec6fae1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ custom/*.bash .rvmrc aliases/custom.aliases.bash lib/custom.bash -plugins/custom.plugins.bash \ No newline at end of file +plugins/custom.plugins.bash +*.swp From f62e241c2af5f096bc043b30e62399d5f06ca5b3 Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Mon, 25 Oct 2010 09:51:22 -0700 Subject: [PATCH 052/126] Updated emacs alias. --- aliases/emacs.aliases.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aliases/emacs.aliases.bash b/aliases/emacs.aliases.bash index 8115f163..5b328768 100644 --- a/aliases/emacs.aliases.bash +++ b/aliases/emacs.aliases.bash @@ -1,4 +1,3 @@ #!/bin/bash -alias em="emacs" -alias emac="open -a emacs" \ No newline at end of file +alias em="open -a emacs" \ No newline at end of file From 2f9752f49b8ae921d866b2e9fd46207ae079461d Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 25 Oct 2010 17:50:55 -0500 Subject: [PATCH 053/126] added irc alias --- aliases/general.aliases.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index ebec1bda..96c153bf 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -16,6 +16,8 @@ alias pager="$PAGER" alias q="exit" +alias irc="$IRC_CLIENT" + # Pianobar can be found here: http://github.com/PromyLOPh/pianobar/ alias piano="pianobar" From 4958a5520bab7288c3125fb07cd3d374f540838b Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 25 Oct 2010 17:51:04 -0500 Subject: [PATCH 054/126] added IRC_CLIENT variable for the irc alias --- template/bash_profile.template.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index f46d71db..787a66b2 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -34,5 +34,9 @@ export JEKYLL_LOCAL_ROOT="~/Sites/mrminimalist" export JEKYLL_REMOTE_ROOT="user@server:/path/to/jekyll/root" +# Change this to your console based IRC client of choice. + +export IRC_CLIENT='irssi' + # Load Bash It source $BASH/bash_it.sh From 75bbdc44f4a4188688370b1d5845a94579e18a89 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Wed, 27 Oct 2010 17:32:06 -0500 Subject: [PATCH 055/126] Added completion support for todo.txt-cli --- completion/todo.completion.bash | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 completion/todo.completion.bash diff --git a/completion/todo.completion.bash b/completion/todo.completion.bash new file mode 100644 index 00000000..00493dbc --- /dev/null +++ b/completion/todo.completion.bash @@ -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 From e127dd0f1a2e291aec9c03c2ed42c9123cf2d525 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 30 Oct 2010 14:54:19 -0500 Subject: [PATCH 056/126] Added check for Linux to make ls with colors work --- aliases/general.aliases.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index 96c153bf..c280b071 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -8,6 +8,11 @@ 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' From cc8c867bc17a5cdd16c5d38bb43ada35c44f8a65 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 30 Oct 2010 15:29:26 -0500 Subject: [PATCH 057/126] Fixed a habitual mistake in using == instead of = for comparison. --- aliases/general.aliases.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index c280b071..396c03e9 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -8,7 +8,7 @@ alias ll='ls -al' alias l='ls -a' alias l1='ls -1' -if [ $(uname) == "Linux" ] +if [ $(uname) = "Linux" ] then alias ls="ls --color=always" fi From 0b3773839b9192cdb31252530378c9e44b7f7e24 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 31 Oct 2010 10:02:25 -0500 Subject: [PATCH 058/126] Added TODO variable for todo.txt-cli aliases --- template/bash_profile.template.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 787a66b2..46d0c4a4 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -38,5 +38,9 @@ export JEKYLL_REMOTE_ROOT="user@server:/path/to/jekyll/root" export IRC_CLIENT='irssi' +# Set this to the command you use for todo.txt-cli + +export TODO="t" + # Load Bash It source $BASH/bash_it.sh From 0e23e82185206311d4cf1e142697b167d5722b92 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 31 Oct 2010 10:05:10 -0500 Subject: [PATCH 059/126] Added todo.txt-cli aliases --- aliases/todo.txt-cli.aliases.bash | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 aliases/todo.txt-cli.aliases.bash diff --git a/aliases/todo.txt-cli.aliases.bash b/aliases/todo.txt-cli.aliases.bash new file mode 100644 index 00000000..69d1a320 --- /dev/null +++ b/aliases/todo.txt-cli.aliases.bash @@ -0,0 +1,7 @@ +#!/bin/bash + +alias tls="$TODO ls" +alias ta="$TODO a" +alias trm="$TODO rm" +alias tdo="$TODO do" +alias tpri="$TODO pri" From 32bbc80069c2b1e5af065bb0a0b182e5e6481a8b Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 31 Oct 2010 15:28:06 -0500 Subject: [PATCH 060/126] Added help for todo.txt-cli aliases. --- aliases/todo.txt-cli.aliases.bash | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aliases/todo.txt-cli.aliases.bash b/aliases/todo.txt-cli.aliases.bash index 69d1a320..045e2f15 100644 --- a/aliases/todo.txt-cli.aliases.bash +++ b/aliases/todo.txt-cli.aliases.bash @@ -5,3 +5,15 @@ 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 +} From 3511e9e2692e7f0cb2bb9d893bbbf2b996e7d1f7 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 31 Oct 2010 15:30:53 -0500 Subject: [PATCH 061/126] Added help for some more aliases --- aliases/general.aliases.bash | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index 396c03e9..201a4197 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -45,18 +45,23 @@ 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 " 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 } From e6fb7030bf832c04cdc5a21d87c8390efa69cf00 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 31 Oct 2010 15:32:22 -0500 Subject: [PATCH 062/126] Added todo-help entry in bash-it.sh's bash-it function --- bash_it.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index 94f9952c..5736f893 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -69,7 +69,7 @@ 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 -} \ No newline at end of file +} From 504643364262429c44aa1a038cd35a0c5ab8c145 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 31 Oct 2010 21:40:08 -0500 Subject: [PATCH 063/126] Spelling Fix. --- custom/example.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom/example.bash b/custom/example.bash index 4f73d862..e9b38474 100644 --- a/custom/example.bash +++ b/custom/example.bash @@ -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. \ No newline at end of file +# This is an example file. Don't use this for your custom scripts. Instead, create another file within the +# custom directory. From a1b611f7f3fc11b61e138b4ce53d532477d77593 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Mon, 1 Nov 2010 13:42:54 +0100 Subject: [PATCH 064/126] added zitron theme --- README.md | 2 ++ themes/zitron/zitron.theme.bash | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 themes/zitron/zitron.theme.bash diff --git a/README.md b/README.md index faeb5d3d..4242bd94 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ If you are submitting a pull request, please add your name to the list. * [Piotr Usewicz][pusewicz] * [Simon H. Eskildsen][sirupsen] * [Mark Szymanski][mrman208] +* [Florian Baumann][noqqe] [revans]: http://github.com/revans [zerobearing2]: http://github.com/zerobearing2 @@ -59,4 +60,5 @@ If you are submitting a pull request, please add your name to the list. [pusewicz]: http://github.com/pusewicz [sirupsen]: http://github.com/sirupsen [mrman208]: http://github.com/mrman208 +[noqqe]: http://github.com/noqqe diff --git a/themes/zitron/zitron.theme.bash b/themes/zitron/zitron.theme.bash new file mode 100644 index 00000000..c0726865 --- /dev/null +++ b/themes/zitron/zitron.theme.bash @@ -0,0 +1,20 @@ +#!/bin/bash +# zitron theme by Florian Baumann + +## 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:" From afbda09a5f80ed5b769b50a089bee753e279bdca Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 17:03:10 -0500 Subject: [PATCH 065/126] Changed names of pager and editor aliases to page and edit, respectively. --- aliases/general.aliases.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases/general.aliases.bash b/aliases/general.aliases.bash index 201a4197..1cb470f1 100644 --- a/aliases/general.aliases.bash +++ b/aliases/general.aliases.bash @@ -16,8 +16,8 @@ fi alias c='clear' alias k='clear' -alias editor="$EDITOR" -alias pager="$PAGER" +alias edit="$EDITOR" +alias page="$PAGER" alias q="exit" From 0097a1e3a835583ca5435326811fe6519d5fd102 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:04:28 -0500 Subject: [PATCH 066/126] Added check to see if user is using vim with newentry alias. --- aliases/jekyll.aliases.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index a3e3fc05..a9fed047 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -1,6 +1,10 @@ -# Open the root of your site in your favorite editor +# Open the root of your site in your vim or cd to it -alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." +if [ $EDITOR = "vim"] +then + alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." +else + alias newentry="cd $JEKYLL_LOCAL_ROOT" # Open the _posts/ directory for making a new blog post (seperate from above alias because not everyone uses jekyll for a blog) From 689afd9b3d28ebe82625a4f191b506cb0dcf7c05 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:05:33 -0500 Subject: [PATCH 067/126] Added check for vim in newpost too. --- aliases/jekyll.aliases.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index a9fed047..0e1e3e75 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -5,10 +5,16 @@ then alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." else alias newentry="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) -alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." +if [ $EDITOR = "vim"] +then + alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." +else + alias newpost="cd $JEKYLL_LOCAL_ROOT" +fi # Build and locally serve the site From db5a47eb684510714a81466b9b556538c32dcdd1 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:06:57 -0500 Subject: [PATCH 068/126] Syntax Fixes --- aliases/jekyll.aliases.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index 0e1e3e75..4e0d740e 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -1,6 +1,6 @@ # Open the root of your site in your vim or cd to it -if [ $EDITOR = "vim"] +if [ $EDITOR = "vim" ] then alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." else @@ -9,7 +9,7 @@ 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"] +if [ $EDITOR = "vim" ] then alias newpost="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." else From a8fc3c78d9d137f4468d89c76b95412a66b0ed18 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:24:39 -0500 Subject: [PATCH 069/126] Added jekyll.plugins.bash file --- plugins/jekyll.plugins.bash | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 plugins/jekyll.plugins.bash diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash new file mode 100644 index 00000000..31fb9a3a --- /dev/null +++ b/plugins/jekyll.plugins.bash @@ -0,0 +1,12 @@ +newpost() { + + # Get the date for the new post's filename + + FNAME_DATE=$(date "+%Y-%m-%d") + + # Get the title for the new post + + read -p "Enter title of the new post: " POST_TITLE + + +} From 61fcd21162c5d914689d1efdaa10df16ee70a4f9 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:24:53 -0500 Subject: [PATCH 070/126] Added the last jekyll variable we will need... hopefully. --- template/bash_profile.template.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 46d0c4a4..31e6645b 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -28,12 +28,17 @@ unset MAILCHECK # Change this to the path of your local jekyll root to use the jekyll aliases -export JEKYLL_LOCAL_ROOT="~/Sites/mrminimalist" +export JEKYLL_LOCAL_ROOT="~/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' From ea84e4b7a6ed84ad718ba43aeabf16e5264953f7 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:49:07 -0500 Subject: [PATCH 071/126] Got rid of old "newpost" alias to make way for the "newpost" function. --- aliases/jekyll.aliases.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index 4e0d740e..c447894d 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -9,12 +9,12 @@ 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="cd $JEKYLL_LOCAL_ROOT/_posts && $EDITOR ." -else - alias newpost="cd $JEKYLL_LOCAL_ROOT" -fi +# if [ $editor = "vim" ] +# then +# alias newpost="cd $jekyll_local_root/_posts && $editor ." +# else +# alias newpost="cd $jekyll_local_root" +# fi # Build and locally serve the site From 1a045dea98f647ade67463125991f021a559c7fd Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:49:57 -0500 Subject: [PATCH 072/126] Added newpost plugin. Creates a new jekyll post with the current date, and a user specified title. Even fills in the YAML Front Matter. Sorry if that seemed like bragging, I just wanted everyone to notice so they could make use of it better... --- plugins/jekyll.plugins.bash | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index 31fb9a3a..1933f074 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -1,5 +1,9 @@ newpost() { + # 'cd' into the local jekyll root + + cd "$JEKYLL_LOCAL_ROOT/_posts" + # Get the date for the new post's filename FNAME_DATE=$(date "+%Y-%m-%d") @@ -8,5 +12,45 @@ newpost() { 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 + + # Open the file in your favorite editor + + $EDITOR $FNAME } From 1dd1add7a7ac06c103a0c302c45bdabdc5becbb4 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 1 Nov 2010 20:57:35 -0500 Subject: [PATCH 073/126] Changed "~" to "$HOME" for JEKYLL_LOCAL_ROOT variable. Sometimes ~ works, sometimes not. I know for a fact that $HOME does though. --- template/bash_profile.template.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 31e6645b..a98e65c8 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -28,7 +28,7 @@ unset MAILCHECK # Change this to the path of your local jekyll root to use the jekyll aliases -export JEKYLL_LOCAL_ROOT="~/Sites/jekyllsite" +export JEKYLL_LOCAL_ROOT="$HOME/Sites/jekyllsite" # And change this to the remote server and root From e45e72ec2705445476ee37725ded19eace970857 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Tue, 2 Nov 2010 14:50:45 +0100 Subject: [PATCH 074/126] usage() for os x and linux --- plugins/base.plugin.bash | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index 2d780287..d19b149c 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -32,12 +32,21 @@ pri() { # disk usage per directory +# in Mac OS X and Linux usage () { - if [ $1 ] - then - du -hd $1 - else - du -hd 1 - fi + 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 } From 044a116fcdcddf45f574b71b740e3e7a4a1ab2ea Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Tue, 2 Nov 2010 13:45:21 -0700 Subject: [PATCH 075/126] fixing an argument error --- aliases/jekyll.aliases.bash | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index c447894d..a5078e32 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -1,10 +1,8 @@ # Open the root of your site in your vim or cd to it -if [ $EDITOR = "vim" ] -then - alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." -else - alias newentry="cd $JEKYLL_LOCAL_ROOT" +if [[ $EDITOR = "vim" ]] +then alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." +else alias newentry="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) From 827578c79ff4e8c615393e2548909a66e1fb4333 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Thu, 4 Nov 2010 18:19:50 +0100 Subject: [PATCH 076/126] added dock-switch to osx plugin. switches between 3d and 2d --- plugins/osx.plugin.bash | 24 ++++++++++++++++++++++++ themes/zitron/zitron.theme.bash | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/plugins/osx.plugin.bash b/plugins/osx.plugin.bash index c366b3f6..a24f012b 100644 --- a/plugins/osx.plugin.bash +++ b/plugins/osx.plugin.bash @@ -11,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 "dockswitch 2d" + echo "dockswitch 3d." + fi + else + echo "sorry. you're currently not using os x" + fi +} diff --git a/themes/zitron/zitron.theme.bash b/themes/zitron/zitron.theme.bash index c0726865..980b19a1 100644 --- a/themes/zitron/zitron.theme.bash +++ b/themes/zitron/zitron.theme.bash @@ -17,4 +17,4 @@ 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:" +export LS_COLORS="no=00:fi=00:di=01;97: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:" From e1761160dfbf4e7d9a5aed5bb54e1f47ddbe7cff Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Thu, 4 Nov 2010 18:24:02 +0100 Subject: [PATCH 077/126] spelling error in usage --- plugins/osx.plugin.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/osx.plugin.bash b/plugins/osx.plugin.bash index a24f012b..e6271bd7 100644 --- a/plugins/osx.plugin.bash +++ b/plugins/osx.plugin.bash @@ -28,8 +28,8 @@ function dock-switch() { else echo "usage:" - echo "dockswitch 2d" - echo "dockswitch 3d." + echo "dock-switch 2d" + echo "dock-switch 3d." fi else echo "sorry. you're currently not using os x" From 5a7174a7345da5fd1ef1c3be7e77aac0232dad8e Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Thu, 4 Nov 2010 13:09:40 -0500 Subject: [PATCH 078/126] Added banish-cookies function. Inspired by http://onethingwell.org/post/1480517866/banish-flash-cookies --- plugins/base.plugin.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index d19b149c..f9e1370c 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -30,6 +30,11 @@ pri() { ri -T "${1}" | open -f -a $PREVIEW } +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 From 4b26a7874506859a5a474e93fb9f5394484f60c9 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 5 Nov 2010 15:02:12 -0500 Subject: [PATCH 079/126] Added t alias for one thing todo. Inspired by http://onethingwell.org/post/758016936/one-thing-todo --- plugins/base.plugin.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index f9e1370c..c30d7311 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -55,3 +55,14 @@ usage () fi fi } + +# One thing todo + + t() { + if [[ "$*" == "" ]] ; then + cat ~/.t + else + echo "$*" > ~/.t + fi + } + From 64eb33844d3661e5290571e93298988788297f19 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 5 Nov 2010 15:27:03 -0500 Subject: [PATCH 080/126] Fixed error that would occur on Mac OS X reporting misplaced ) --- plugins/base.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index c30d7311..b1706e92 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -58,7 +58,7 @@ usage () # One thing todo - t() { +function t() { if [[ "$*" == "" ]] ; then cat ~/.t else From cecbae54e533c619dca589c44300011d0307ea0e Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Mon, 8 Nov 2010 21:31:11 +0100 Subject: [PATCH 081/126] added plugins-help message --- plugins/base.plugin.bash | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index b1706e92..1e73df57 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -57,12 +57,30 @@ usage () } # 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=()" \ + | sed -e "s/()//" +} + From 6a890d21c98db4552e13a0db2372d5aa669d8293 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Mon, 8 Nov 2010 21:40:16 +0100 Subject: [PATCH 082/126] os x fix for plugins-help() --- plugins/base.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index 1e73df57..9eceaf94 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -80,7 +80,7 @@ function plugins-help() { | grep -v "GROUPS=()" \ | grep -v "BASH_CMDS=()" \ | grep -v "BASH_ALIASES=()" \ - | sed -e "s/()//" + | grep -v "COMPREPLY=()" | sed -e "s/()//" } From bd2248563945e20545e2271c8e8c9da2fbf2dd75 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Mon, 8 Nov 2010 21:52:49 +0100 Subject: [PATCH 083/126] added documentation for plugins-help --- README.md | 1 + bash_it.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 4242bd94..742daf1e 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Check a clone of this repo. You can view what a sample `~/.bash_profile` looks l aliases-help rails-help git-help + plugins-help ## Your Custom scripts, aliases, and functions diff --git a/bash_it.sh b/bash_it.sh index 5736f893..2364d04a 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -71,5 +71,6 @@ function bash-it() { 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 } From d5645e74a0eacf0c7cf743c09a5dad1ff990db8a Mon Sep 17 00:00:00 2001 From: John Schulz Date: Tue, 9 Nov 2010 23:21:19 -0500 Subject: [PATCH 084/126] Theme changes * Load colors before base theme so they can be used by base theme * Change git-specific variables to SCM-agnostic ones --- bash_it.sh | 9 +-- themes/base.theme.bash | 85 ++++++++++++++++++++++++----- themes/bobby/bobby.theme.bash | 7 ++- themes/candy/candy.theme.bash | 2 +- themes/clean/clean.theme.bash | 2 +- themes/pete/pete.theme.bash | 10 ++-- themes/simple/simple.theme.bash | 17 ++---- themes/standard/standard.theme.bash | 10 ++-- themes/zitron/zitron.theme.bash | 2 +- 9 files changed, 98 insertions(+), 46 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index 5736f893..0d42fcc9 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -6,12 +6,9 @@ alias reload='source ~/.bash_profile' # 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" diff --git a/themes/base.theme.bash b/themes/base.theme.bash index f898875b..9ae5d0e8 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -1,27 +1,82 @@ #!/bin/bash -# Stolen from Steve Losh -function prompt_char { - git branch >/dev/null 2>/dev/null && echo -e '±' && return - hg root >/dev/null 2>/dev/null && echo -e '☿' && return - echo -e '○' -} +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 -e "$GIT_THEME_PROMPT_DIRTY" - else - echo -e "$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() { - ref=$(git symbolic-ref HEAD 2> /dev/null) || return - echo -e "$GIT_THEME_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$GIT_THEME_PROMPT_SUFFIX" +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 +} -function rvm_version_prompt() { +# 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) ]]; 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 -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" diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index 8eb50c54..f0f84476 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -1,6 +1,10 @@ #!/bin/bash +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_PREFIX=" |" +SCM_THEME_PROMPT_SUFFIX="${green}|" -PROMPT="\[${bold_blue}\]\[\$(prompt_char)\]\[\$(git_prompt_info)\]\[${blue}\]\[\$(rvm_version_prompt) \]\[${orange}\]\h \[${reset_color}\]in \[${green}\]\w \[${reset_color}\]\[→ " +PROMPT="${bold_blue}\[\$(scm_char)\]${green}\$(scm_prompt_info)${blue}\$(rvm_version_prompt) ${orange}\h ${reset_color}in ${green}\w ${reset_color}\]\[→ " # git theming GIT_THEME_PROMPT_DIRTY=" ${red}✗" @@ -10,3 +14,4 @@ GIT_THEME_PROMPT_SUFFIX="${green}|" RVM_THEME_PROMPT_PREFIX=" |" RVM_THEME_PROMPT_SUFFIX="|" + diff --git a/themes/candy/candy.theme.bash b/themes/candy/candy.theme.bash index 7158a9e7..ef0ba262 100644 --- a/themes/candy/candy.theme.bash +++ b/themes/candy/candy.theme.bash @@ -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} " \ No newline at end of file +PROMPT="${green}\u@\h ${blue}\T ${reset_color}${white}\w${reset_color}\[\$(scm_prompt_info)\]${blue} →${bold_blue} \$${reset_color} " \ No newline at end of file diff --git a/themes/clean/clean.theme.bash b/themes/clean/clean.theme.bash index 88949fd0..2fc418f8 100644 --- a/themes/clean/clean.theme.bash +++ b/themes/clean/clean.theme.bash @@ -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]' diff --git a/themes/pete/pete.theme.bash b/themes/pete/pete.theme.bash index 1f9b4fc9..95f243af 100644 --- a/themes/pete/pete.theme.bash +++ b/themes/pete/pete.theme.bash @@ -5,16 +5,16 @@ prompt_setter() { history -a history -c history -r - PS1="(\t) $(prompt_char) [\[$blue\]\u\[$reset_color\]@\[$green\]\H\[$reset_color\]] \[$yellow\]\w\[$reset_color\]$(git_prompt_info)$(rvm_version_prompt) $\[$reset_color\] " + 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 -GIT_THEME_PROMPT_DIRTY=" ✗" -GIT_THEME_PROMPT_CLEAN=" ✓" -GIT_THEME_PROMPT_PREFIX=" (" -GIT_THEME_PROMPT_SUFFIX=")" +SCM_THEME_PROMPT_DIRTY=" ✗" +SCM_THEME_PROMPT_CLEAN=" ✓" +SCM_THEME_PROMPT_PREFIX=" (" +SCM_THEME_PROMPT_SUFFIX=")" RVM_THEME_PROMPT_PREFIX=" (" RVM_THEME_PROMPT_SUFFIX=")" diff --git a/themes/simple/simple.theme.bash b/themes/simple/simple.theme.bash index 5a8d5d91..2dcd7e7c 100644 --- a/themes/simple/simple.theme.bash +++ b/themes/simple/simple.theme.bash @@ -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=")" diff --git a/themes/standard/standard.theme.bash b/themes/standard/standard.theme.bash index 61a9cbc3..5ba288c1 100644 --- a/themes/standard/standard.theme.bash +++ b/themes/standard/standard.theme.bash @@ -2,11 +2,11 @@ PROMPT='\[${green}\]\u\[${normal}\]@\[${green}\]\h\[${normal}\]:\[${blue}\]\w\[$ -# git themeing -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="" # TODO: need a check for OS before adding this to the prompt # ${debian_chroot:+($debian_chroot)} diff --git a/themes/zitron/zitron.theme.bash b/themes/zitron/zitron.theme.bash index 980b19a1..c0726865 100644 --- a/themes/zitron/zitron.theme.bash +++ b/themes/zitron/zitron.theme.bash @@ -17,4 +17,4 @@ 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;97: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:" +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:" From e7cfe6d1dfd1591926979c7267354d19767e4221 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Tue, 9 Nov 2010 23:52:25 -0500 Subject: [PATCH 085/126] Lost the wrapping for non-printable characters --- themes/bobby/bobby.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index f0f84476..c8d6204a 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -4,7 +4,7 @@ SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" SCM_THEME_PROMPT_PREFIX=" |" SCM_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}\]\[→ " +PROMPT="\[${bold_blue}\]\[\$(scm_char)\]\[${green}\]\[\$(scm_prompt_info)\]\[${blue}\]\[\$(rvm_version_prompt)\] \[${orange}\]\h \[${reset_color}\]in \[${green}\]\w \[${reset_color}\]\[→ " # git theming GIT_THEME_PROMPT_DIRTY=" ${red}✗" From 7ce4184c939fe141230344ded3add3de6492115d Mon Sep 17 00:00:00 2001 From: John Schulz Date: Wed, 10 Nov 2010 11:46:05 -0500 Subject: [PATCH 086/126] Alter test for `brew` to prevent false positive. `brew` reports 'no brew found in ...' to `stdout` (at least on Solaris) resulting in a false positive. --- completion/brew.completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completion/brew.completion.bash b/completion/brew.completion.bash index a0d98193..371fe77f 100644 --- a/completion/brew.completion.bash +++ b/completion/brew.completion.bash @@ -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 From 02d65afdcbdbfd2a8cdfedec353e992ad0d0bfe0 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Wed, 10 Nov 2010 20:25:40 +0100 Subject: [PATCH 087/126] added pipe-able browser hack from defunkt --- plugins/browser.plugin.bash | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 plugins/browser.plugin.bash diff --git a/plugins/browser.plugin.bash b/plugins/browser.plugin.bash new file mode 100644 index 00000000..6de184c3 --- /dev/null +++ b/plugins/browser.plugin.bash @@ -0,0 +1,29 @@ +# based on https://gist.github.com/318247 + +# Usage: browser +# pipe html to a browser +# e.g. +# $ echo "

hi mom!

" | browser +# $ ron -5 man/rip.5.ron | browser + +function browser() { + if [ -t 0 ]; then + if [ -n "$1" ]; then + open $1 + else + cat <hi mom!' | browser +$ ron -5 man/rip.5.ron | browser +usage + + fi + + else + f="/tmp/browser.$RANDOM.html" + cat /dev/stdin > $f + open $f + fi +} From 1148f42c5b117612b18bbb296b025f2e8be968b8 Mon Sep 17 00:00:00 2001 From: Robert R Evans Date: Wed, 10 Nov 2010 15:45:48 -0800 Subject: [PATCH 088/126] Updated bobby theme and merged in noqqe's additions --- themes/bobby/bobby.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/bobby/bobby.theme.bash b/themes/bobby/bobby.theme.bash index 8eb50c54..c8e34473 100644 --- a/themes/bobby/bobby.theme.bash +++ b/themes/bobby/bobby.theme.bash @@ -1,6 +1,6 @@ #!/bin/bash -PROMPT="\[${bold_blue}\]\[\$(prompt_char)\]\[\$(git_prompt_info)\]\[${blue}\]\[\$(rvm_version_prompt) \]\[${orange}\]\h \[${reset_color}\]in \[${green}\]\w \[${reset_color}\]\[→ " +PROMPT="\[${bold_blue}\]\[\$(prompt_char)\]\[\$(git_prompt_info)\]\[${blue}\]\[\$(rvm_version_prompt) \]\[${orange}\]\h \[${reset_color}\]in \[${green}\]\w \[${reset_color}\]\[\n\[${bold_blue}\]→\[${reset_color}\] " # git theming GIT_THEME_PROMPT_DIRTY=" ${red}✗" From 6e7f4239832abe6b8694695af4f312bb8a02badc Mon Sep 17 00:00:00 2001 From: John Schulz Date: Thu, 11 Nov 2010 11:57:47 -0500 Subject: [PATCH 089/126] =?UTF-8?q?Allow=20theming=20to=20be=20disabled=20?= =?UTF-8?q?(eg=20for=20old=20terminals)=20=20*=20Only=20load=20a=20theme?= =?UTF-8?q?=20file=20if=20`bobby`=20has=20been=20set=20=20*=20Only=20alter?= =?UTF-8?q?=20`PS1`=20if=20`\[=1B[1;34m\]\[$(scm=5Fchar)\]\[=1B[0;32m\]\[$?= =?UTF-8?q?(scm=5Fprompt=5Finfo)\]\[=1B[0;34m\]\[$(rvm=5Fversion=5Fprompt)?= =?UTF-8?q?\]=20\[=1B[33;40m\]\h=20\[=1B[39m\]in=20\[=1B[0;32m\]\w=20\[=1B?= =?UTF-8?q?[39m\]\[\n\[=1B[0;32m\]=E2=86=92\[=1B[39m\]=20`=20has=20a=20val?= =?UTF-8?q?ue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash_it.sh | 5 +++-- lib/appearance.bash | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index f0c850c2..60bef802 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -47,8 +47,9 @@ done unset config_file -export PS1=$PROMPT - +if [[ $PROMPT ]]; then + export PS1=$PROMPT +fi # Adding Support for other OSes PREVIEW="less" diff --git a/lib/appearance.bash b/lib/appearance.bash index 4b1f568e..f7235118 100644 --- a/lib/appearance.bash +++ b/lib/appearance.bash @@ -8,4 +8,6 @@ export GREP_COLOR='1;33' export LSCOLORS='Gxfxcxdxdxegedabagacad' # Load the theme -source "$BASH/themes/$BASH_THEME/$BASH_THEME.theme.bash" \ No newline at end of file +if [[ $BASH_THEME ]]; then + source "$BASH/themes/$BASH_THEME/$BASH_THEME.theme.bash" +fi \ No newline at end of file From 760cc8be63180ab102af5e81684af74fd74cfe10 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Thu, 11 Nov 2010 12:45:32 -0500 Subject: [PATCH 090/126] Add `gmu` (git merge upstream) alias * Pull in `origin` & `upstream` and merge them into `upstream/master` from http://www.gitready.com/intermediate/2009/02/12/easily-fetching-upstream-changes.html --- aliases/git.aliases.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aliases/git.aliases.bash b/aliases/git.aliases.bash index 40d87802..0ac25486 100644 --- a/aliases/git.aliases.bash +++ b/aliases/git.aliases.bash @@ -23,6 +23,7 @@ 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*) @@ -61,7 +62,8 @@ function git-help() { echo " gcp = git cherry-pick" echo " gco = git checkout" echo " gexport = git git archive --format zip --output" - echo " gdel = git branch -D" - echo " gpo = git push origin" + 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 } From 7b1312002fccf4053adc5e7c8b53693f72c5f2f3 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 13 Nov 2010 10:21:59 -0600 Subject: [PATCH 091/126] Changed 'cd's to 'builtin cd's, because I have a modified cd command (cd then ls) and it can get annoying when using the Jekyll aliases. --- aliases/jekyll.aliases.bash | 16 ++++++++-------- plugins/jekyll.plugins.bash | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/aliases/jekyll.aliases.bash b/aliases/jekyll.aliases.bash index a5078e32..11922d6c 100644 --- a/aliases/jekyll.aliases.bash +++ b/aliases/jekyll.aliases.bash @@ -1,27 +1,27 @@ -# Open the root of your site in your vim or cd to it +# Open the root of your site in your vim or builtin cd to it if [[ $EDITOR = "vim" ]] -then alias newentry="cd $JEKYLL_LOCAL_ROOT && $EDITOR ." -else alias newentry="cd $JEKYLL_LOCAL_ROOT" +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="cd $jekyll_local_root/_posts && $editor ." +# alias newpost="builtin cd $jekyll_local_root/_posts && $editor ." # else -# alias newpost="cd $jekyll_local_root" +# alias newpost="builtin cd $jekyll_local_root" # fi # Build and locally serve the site -alias testsite="cd $JEKYLL_LOCAL_ROOT && jekyll --server --auto" +alias testsite="builtin cd $JEKYLL_LOCAL_ROOT && jekyll --server --auto" # Build but don't locally serve the site -alias buildsite="cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" +alias buildsite="builtin cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" # Rsync the site to the remote server -alias deploysite="cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT" +alias deploysite="builtin cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT" diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index 1933f074..00ac7b0f 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -1,8 +1,8 @@ newpost() { - # 'cd' into the local jekyll root + # 'builtin cd' into the local jekyll root - cd "$JEKYLL_LOCAL_ROOT/_posts" + builtin cd "$JEKYLL_LOCAL_ROOT/_posts" # Get the date for the new post's filename From c8f94b08926181e190d6986d795ef1933e024b33 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 15 Nov 2010 20:03:35 -0600 Subject: [PATCH 092/126] Added shebang --- plugins/jekyll.plugins.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index 00ac7b0f..9a044a99 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -1,3 +1,5 @@ +#!/bin/bash + newpost() { # 'builtin cd' into the local jekyll root From 12d8abda060e06a1704b26ea8411fde7b0089b60 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 15 Nov 2010 20:29:36 -0600 Subject: [PATCH 093/126] Added ability to choose post type with newpost() function. --- plugins/jekyll.plugins.bash | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index 9a044a99..adb39fcc 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -10,6 +10,44 @@ newpost() { 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. + # TODO: Add support for Textile formatting too. + + OPTIONS="Text Quote Image Audio Video" + + 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 + done + # Get the title for the new post read -p "Enter title of the new post: " POST_TITLE @@ -52,6 +90,35 @@ newpost() { echo "---" >> $FNAME echo >> $FNAME + # Generate template text based on the post type + + if [[ $POST_TYPE = "Text" ]] + then + true + fi + + if [[ $POST_TYPE = "Quote" ]] + then + echo "> Quote" >> $FNAME + echo >> $FNAME + echo "— Author" >> $FNAME + fi + + if [[ $POST_TYPE = "Image" ]] + then + echo "![Alternate Text](/path/to/image/or/url)" >> $FNAME + fi + + if [[ $POST_TYPE = "Audio" ]] + then + echo "" >> $FNAME + fi + + if [[ $POST_TYPE = "Video" ]] + then + echo "" >> $FNAME + fi + # Open the file in your favorite editor $EDITOR $FNAME From 14c78bff05efa06b98bfe875281f9866ecca949b Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 15 Nov 2010 20:31:38 -0600 Subject: [PATCH 094/126] Added check to make sure the user is using Markdown formatting with newpost() --- plugins/jekyll.plugins.bash | 106 +++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 50 deletions(-) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index adb39fcc..ef8888c6 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -14,39 +14,42 @@ newpost() { # TODO: Add support for Textile formatting too. OPTIONS="Text Quote Image Audio Video" - - 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 [[ $JEKYLL_FORMATTING = "markdown" ]] + then + select OPTION in $OPTIONS + do + if [[ $OPTION = "Text" ]] + then + POST_TYPE="Text" + break + fi - if [[ $OPTION = "Audio" ]] - then - POST_TYPE="Audio" - break - fi + if [[ $OPTION = "Quote" ]] + then + POST_TYPE="Quote" + break + fi + + if [[ $OPTION = "Image" ]] + then + POST_TYPE="Image" + break + fi - if [[ $OPTION = "Video" ]] - then - POST_TYPE="Video" - break - fi - done + if [[ $OPTION = "Audio" ]] + then + POST_TYPE="Audio" + break + fi + + if [[ $OPTION = "Video" ]] + then + POST_TYPE="Video" + break + fi + done + fi # Get the title for the new post @@ -92,31 +95,34 @@ newpost() { # Generate template text based on the post type - if [[ $POST_TYPE = "Text" ]] + if [[ $JEKYLL_FORMATTING = "markdown" ]] then - true - fi + if [[ $POST_TYPE = "Text" ]] + then + true + fi - if [[ $POST_TYPE = "Quote" ]] - then - echo "> Quote" >> $FNAME - echo >> $FNAME - echo "— Author" >> $FNAME - fi + if [[ $POST_TYPE = "Quote" ]] + then + echo "> Quote" >> $FNAME + echo >> $FNAME + echo "— Author" >> $FNAME + fi - if [[ $POST_TYPE = "Image" ]] - then - echo "![Alternate Text](/path/to/image/or/url)" >> $FNAME - fi + if [[ $POST_TYPE = "Image" ]] + then + echo "![Alternate Text](/path/to/image/or/url)" >> $FNAME + fi - if [[ $POST_TYPE = "Audio" ]] - then - echo "" >> $FNAME - fi + if [[ $POST_TYPE = "Audio" ]] + then + echo "" >> $FNAME + fi - if [[ $POST_TYPE = "Video" ]] - then - echo "" >> $FNAME + if [[ $POST_TYPE = "Video" ]] + then + echo "" >> $FNAME + fi fi # Open the file in your favorite editor From 415d8b7458f6d77c072fc1cecdd7761008666b18 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 15 Nov 2010 20:42:36 -0600 Subject: [PATCH 095/126] Added support for Textile formatting in newpost() --- plugins/jekyll.plugins.bash | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index ef8888c6..9b0d5c1e 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -11,11 +11,10 @@ newpost() { 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. - # TODO: Add support for Textile formatting too. OPTIONS="Text Quote Image Audio Video" - if [[ $JEKYLL_FORMATTING = "markdown" ]] + if [ $JEKYLL_FORMATTING = "markdown" -o $JEKYLL_FORMATTING = "textile" ] then select OPTION in $OPTIONS do @@ -116,12 +115,42 @@ newpost() { if [[ $POST_TYPE = "Audio" ]] then - echo "" >> $FNAME + echo "" >> $FNAME fi if [[ $POST_TYPE = "Video" ]] then - echo "" >> $FNAME + echo "" >> $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 "— Author" >> $FNAME + fi + + if [[ $POST_TYPE = "Image" ]] + then + echo "!url(alt text)" >> $FNAME + fi + + if [[ $POST_TYPE = "Audio" ]] + then + echo "" >> $FNAME + fi + + if [[ $POST_TYPE = "Video" ]] + then + echo "" >> $FNAME fi fi From cb681121e42572f312edc463d6b9e9e98087026d Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Wed, 17 Nov 2010 17:09:16 -0600 Subject: [PATCH 096/126] Added custom PS3 (prompt used with "select", for instance with the new, newpost comman) for minimal theme --- themes/minimal/minimal.theme.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash index e70165d2..2f9b926e 100644 --- a/themes/minimal/minimal.theme.bash +++ b/themes/minimal/minimal.theme.bash @@ -7,3 +7,5 @@ prompt_setter() { } PROMPT_COMMAND=prompt_setter + +export PS3=">> " From 4350c3f13fbe2f615012d1e9bf147d578d77c31f Mon Sep 17 00:00:00 2001 From: Fedyashev Nikita Date: Thu, 18 Nov 2010 23:42:30 -0500 Subject: [PATCH 097/126] Vagrant autocompletion: base working version --- plugins/vagrant.plugins.bash | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 plugins/vagrant.plugins.bash diff --git a/plugins/vagrant.plugins.bash b/plugins/vagrant.plugins.bash new file mode 100644 index 00000000..3d05f7ec --- /dev/null +++ b/plugins/vagrant.plugins.bash @@ -0,0 +1,34 @@ +#!/bin/bash +_vagrant() +{ + local cur prev commands + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + # The commands we will complete + commands="box destroy halt help init package provision reload resume ssh ssh_config status suspend up version" + + case "${prev}" in + "remove"|"repackage") + #local vagrantlist=$(gem list -l|grep '([0-9].*)'|awk 'BEGIN {ORS=" "} { print $1}'|sort) + #local vagrantlist=$(command ls --color=none -l $HOME/.vagrant/boxes 2>/dev/null | sed -e 's/ /\\ /g' | awk 'BEGIN {ORS=" "} {print $2}' ) + local vagrantlist=$(find $HOME/.vagrant/boxes/* -maxdepth 0 -type d -printf '%f ') + COMPREPLY=($(compgen -W "${vagrantlist}" -- ${cur})) + return 0 + ;; + "box") + commands="add help list remove repackage" + COMPREPLY=($(compgen -W "${commands}" -- ${cur})) + return 0 + ;; + *) + ;; + esac + + COMPREPLY=($(compgen -W "${commands}" -- ${cur})) + return 0 +} +complete -F _vagrant vagrant +complete -F _vagrant vagrant-e + From 5f6125e480267a2bcd52827f4430b7cec2ab35df Mon Sep 17 00:00:00 2001 From: Fedyashev Nikita Date: Fri, 19 Nov 2010 00:22:13 -0500 Subject: [PATCH 098/126] refactored version; valid workflow --- plugins/vagrant.plugins.bash | 56 +++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/plugins/vagrant.plugins.bash b/plugins/vagrant.plugins.bash index 3d05f7ec..27b3761f 100644 --- a/plugins/vagrant.plugins.bash +++ b/plugins/vagrant.plugins.bash @@ -1,34 +1,44 @@ #!/bin/bash _vagrant() { - local cur prev commands - COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - # The commands we will complete - commands="box destroy halt help init package provision reload resume ssh ssh_config status suspend up version" - case "${prev}" in - "remove"|"repackage") - #local vagrantlist=$(gem list -l|grep '([0-9].*)'|awk 'BEGIN {ORS=" "} { print $1}'|sort) - #local vagrantlist=$(command ls --color=none -l $HOME/.vagrant/boxes 2>/dev/null | sed -e 's/ /\\ /g' | awk 'BEGIN {ORS=" "} {print $2}' ) - local vagrantlist=$(find $HOME/.vagrant/boxes/* -maxdepth 0 -type d -printf '%f ') - COMPREPLY=($(compgen -W "${vagrantlist}" -- ${cur})) - return 0 - ;; - "box") - commands="add help list remove repackage" - COMPREPLY=($(compgen -W "${commands}" -- ${cur})) - return 0 - ;; - *) - ;; - esac + if [ $COMP_CWORD == 1 ] + then + commands="box destroy halt help init package provision reload resume ssh ssh_config status suspend up version" + COMPREPLY=($(compgen -W "${commands}" -- ${cur})) + return 0 + fi + + if [ $COMP_CWORD == 2 ] + then + if [ $prev == 'box' ] + then + commands="add help list remove repackage" + COMPREPLY=($(compgen -W "${commands}" -- ${cur})) + return 0 + fi + fi + + if [ $COMP_CWORD == 3 ] + then + action="${COMP_WORDS[COMP_CWORD-2]}" + if [ $action == 'box' ] + then + case "$prev" in + "remove"|"repackage") + local vagrantlist=$(find $HOME/.vagrant/boxes/* -maxdepth 0 -type d -printf '%f ') + COMPREPLY=($(compgen -W "${vagrantlist}" -- ${cur})) + return 0 + ;; + *) + ;; + esac + fi + fi - COMPREPLY=($(compgen -W "${commands}" -- ${cur})) - return 0 } complete -F _vagrant vagrant -complete -F _vagrant vagrant-e From 7f721fe5e7bc9d845d177beb044c096d95b155b8 Mon Sep 17 00:00:00 2001 From: Fedyashev Nikita Date: Fri, 19 Nov 2010 00:27:14 -0500 Subject: [PATCH 099/126] completion to help command added --- plugins/vagrant.plugins.bash | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/plugins/vagrant.plugins.bash b/plugins/vagrant.plugins.bash index 27b3761f..17aff4ea 100644 --- a/plugins/vagrant.plugins.bash +++ b/plugins/vagrant.plugins.bash @@ -3,23 +3,29 @@ _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 - commands="box destroy halt help init package provision reload resume ssh ssh_config status suspend up version" COMPREPLY=($(compgen -W "${commands}" -- ${cur})) return 0 fi if [ $COMP_CWORD == 2 ] then - if [ $prev == 'box' ] - then - commands="add help list remove repackage" - COMPREPLY=($(compgen -W "${commands}" -- ${cur})) - return 0 - fi + 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 ] @@ -29,8 +35,8 @@ _vagrant() then case "$prev" in "remove"|"repackage") - local vagrantlist=$(find $HOME/.vagrant/boxes/* -maxdepth 0 -type d -printf '%f ') - COMPREPLY=($(compgen -W "${vagrantlist}" -- ${cur})) + local box_list=$(find $HOME/.vagrant/boxes/* -maxdepth 0 -type d -printf '%f ') + COMPREPLY=($(compgen -W "${box_list}" -- ${cur})) return 0 ;; *) From 62295973ca3bce1990a859b1f085b62cf9fd4d55 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 20 Nov 2010 16:27:47 -0600 Subject: [PATCH 100/126] Added quiet function to run command in background. --- plugins/base.plugin.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/base.plugin.bash b/plugins/base.plugin.bash index 9eceaf94..9c8cb922 100644 --- a/plugins/base.plugin.bash +++ b/plugins/base.plugin.bash @@ -30,6 +30,10 @@ pri() { ri -T "${1}" | open -f -a $PREVIEW } +quiet() { + $* &> /dev/null & +} + banish-cookies() { rm -r ~/.macromedia ~/.adobe ln -s /dev/null ~/.adobe From 8c6197717a9ed9e318951bcae37cfe522491c3db Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Mon, 22 Nov 2010 11:44:28 +0100 Subject: [PATCH 101/126] fixed debian dirty prompt bug --- themes/base.theme.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 9ae5d0e8..e77d1d23 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -50,7 +50,7 @@ function prompt_char { } function git_prompt_info { - if [[ -n $(git status -s 2> /dev/null) ]]; then + 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} @@ -81,4 +81,4 @@ function rvm_version_prompt { rvm=$(rvm tools identifier) || return echo -e "$RVM_THEME_PROMPT_PREFIX$rvm$RVM_THEME_PROMPT_SUFFIX" fi -} \ No newline at end of file +} From aaa107161bd7dd12517c30aa3f59b07878090e7f Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Mon, 22 Nov 2010 13:07:08 +0100 Subject: [PATCH 102/126] added git_info function to git plugin --- plugins/git.plugins.bash | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/plugins/git.plugins.bash b/plugins/git.plugins.bash index ad21591d..5f4cc51e 100644 --- a/plugins/git.plugins.bash +++ b/plugins/git.plugins.bash @@ -17,4 +17,40 @@ function git_remove_missing_files() { # Adds files to git's exclude file (same as .gitignore) function local-ignore() { echo "$1" >> .git/info/exclude -} \ No newline at end of file +} + +# 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 +} + From 92b8d6d9cfade500e4d514163b5c18a1df71113d Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Wed, 24 Nov 2010 16:22:05 +0100 Subject: [PATCH 103/126] added n0qorg theme --- themes/n0qorg/n0qorg.theme.bash | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 themes/n0qorg/n0qorg.theme.bash diff --git a/themes/n0qorg/n0qorg.theme.bash b/themes/n0qorg/n0qorg.theme.bash new file mode 100644 index 00000000..fcaca43f --- /dev/null +++ b/themes/n0qorg/n0qorg.theme.bash @@ -0,0 +1,22 @@ +#!/bin/bash +# n0qorg theme by Florian Baumann + +## 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=")" From 6cf9a4b03c5ddfa9bb74508242cd9610836c7f09 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 27 Nov 2010 21:00:50 -0600 Subject: [PATCH 104/126] Added link to oh-my-zsh in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 742daf1e..8b8994ef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 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). :) Includes some autocompletion tools, theming support, aliases, custom functions, a few stolen pieces from Steve Losh, and more. From 835bcabf04f405dc97b7082f7d49d7f5cc87e5cd Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 28 Nov 2010 12:37:31 -0600 Subject: [PATCH 105/126] Added Link post type. --- plugins/jekyll.plugins.bash | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index 9b0d5c1e..3ad9d0da 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -12,7 +12,7 @@ newpost() { # 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" + OPTIONS="Text Quote Image Audio Video Link" if [ $JEKYLL_FORMATTING = "markdown" -o $JEKYLL_FORMATTING = "textile" ] then @@ -47,6 +47,12 @@ newpost() { POST_TYPE="Video" break fi + + if [[ $OPTION = "Link" ]] + then + POST_TYPE="Link" + break + fi done fi @@ -122,6 +128,15 @@ newpost() { then echo "" >> $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" ]] @@ -152,6 +167,13 @@ newpost() { then echo "" >> $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 From aa228fb0c37da5525482194f322541ddafd6a2df Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Tue, 30 Nov 2010 16:33:10 +0100 Subject: [PATCH 106/126] added handmade commandline history tool --- plugins/hcht.plugin.bash | 121 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 plugins/hcht.plugin.bash diff --git a/plugins/hcht.plugin.bash b/plugins/hcht.plugin.bash new file mode 100644 index 00000000..c83f6b43 --- /dev/null +++ b/plugins/hcht.plugin.bash @@ -0,0 +1,121 @@ +#!/bin/bash +# hch.plugin.bash: the handmade commandline history tool +# Copyright: (C) 2010 Florian Baumann +# License: GPL-3 +# 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 +# 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. +# *.hch trailor is required. +# +# $ 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. + +### configure store dir +# like /home/user/.hcht/ or something +hchtstoredir="" + +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 +} From d25288fdd3a6dbf2553a703321b40c80f25c9b68 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Tue, 30 Nov 2010 16:41:41 +0100 Subject: [PATCH 107/126] fixed readme --- plugins/hcht.plugin.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/hcht.plugin.bash b/plugins/hcht.plugin.bash index c83f6b43..d9f99d5f 100644 --- a/plugins/hcht.plugin.bash +++ b/plugins/hcht.plugin.bash @@ -10,7 +10,7 @@ # 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 +# 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 @@ -19,7 +19,6 @@ ### create a file # the basic feature. open a file, do stuff and save. -# *.hch trailor is required. # # $ hcht evilcommand.hch # From c00bde6bbdf3762d6d1574b0dfc87ad165d856bd Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Wed, 1 Dec 2010 06:45:42 +0100 Subject: [PATCH 108/126] moved config of hcht to bash_profile template --- plugins/hcht.plugin.bash | 6 +----- template/bash_profile.template.bash | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/hcht.plugin.bash b/plugins/hcht.plugin.bash index d9f99d5f..cdab44fb 100644 --- a/plugins/hcht.plugin.bash +++ b/plugins/hcht.plugin.bash @@ -1,5 +1,5 @@ #!/bin/bash -# hch.plugin.bash: the handmade commandline history tool +# hcht.plugin.bash: the handmade commandline history tool # Copyright: (C) 2010 Florian Baumann # License: GPL-3 # Date: Dienstag 2010-11-30 @@ -52,10 +52,6 @@ # # "anylog" will be the name of the saved file. -### configure store dir -# like /home/user/.hcht/ or something -hchtstoredir="" - hcht() { # configured? if [ -z $hchtstoredir ]; then diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index a98e65c8..17853b1a 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -47,5 +47,8 @@ export IRC_CLIENT='irssi' export TODO="t" +# Set store directory for handmade commandline history tool +export hchtstoredir="$HOME/.hcht" + # Load Bash It source $BASH/bash_it.sh From e0d8582c0b3ba1f551ff7c60d4363a2fe2f6b428 Mon Sep 17 00:00:00 2001 From: Andy Shen Date: Sat, 4 Dec 2010 11:03:33 +1100 Subject: [PATCH 109/126] ssh completion using .ssh/config --- completion/ssh.completion.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 completion/ssh.completion.bash diff --git a/completion/ssh.completion.bash b/completion/ssh.completion.bash new file mode 100644 index 00000000..76913330 --- /dev/null +++ b/completion/ssh.completion.bash @@ -0,0 +1,13 @@ +#!/bin/bash +# Bash completion support for ssh. + +export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/} + +_sshcomplete() { + if [ -f $HOME/.ssh/config ]; then + COMPREPLY=($(compgen -W "`ruby -e"puts open('${HOME}/.ssh/config', 'r') { |f| f.readlines }.find_all { |l| l =~ /^Host/ }.inject([]) { |hosts, line| hosts << line[5..-1].split }.flatten.sort.uniq"`" -- ${COMP_WORDS[COMP_CWORD]})) + return 0 + fi +} + +complete -o default -o nospace -F _sshcomplete ssh From 57fc307e11137021a537088854a915e093ae15d4 Mon Sep 17 00:00:00 2001 From: Andy Shen Date: Sat, 4 Dec 2010 11:06:40 +1100 Subject: [PATCH 110/126] update credit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8b8994ef..e305eb8d 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ If you are submitting a pull request, please add your name to the list. * [Simon H. Eskildsen][sirupsen] * [Mark Szymanski][mrman208] * [Florian Baumann][noqqe] +* [Andy Shen][shenie] [revans]: http://github.com/revans [zerobearing2]: http://github.com/zerobearing2 @@ -62,4 +63,5 @@ If you are submitting a pull request, please add your name to the list. [sirupsen]: http://github.com/sirupsen [mrman208]: http://github.com/mrman208 [noqqe]: http://github.com/noqqe +[shenie]: http://github.com/shenie From 4476156eb82ef1ec746bc7789f7aab47f5593828 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 4 Dec 2010 12:22:32 -0600 Subject: [PATCH 111/126] Added test to see if in vim's shell (via the :sh command) --- themes/minimal/minimal.theme.bash | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash index 2f9b926e..a94c4536 100644 --- a/themes/minimal/minimal.theme.bash +++ b/themes/minimal/minimal.theme.bash @@ -1,8 +1,18 @@ prompt_setter() { if [[ $? -eq 0 ]]; then - PS1="\W " + if [ ! $VIMRUNTIME = "" ] + then + PS1="{vim} \W " + else + PS1="\W " + fi else - PS1="${bold_red}\W ${normal}" + if [ ! $VIMRUNTIME = "" ] + then + PS1="{vim} ${bold_red}\W ${normal}" + else + PS1="${bold_red}\W ${normal}" + fi fi } From 8a3d525460da73b57fb9edfb82f32e35af767047 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 15:40:46 -0600 Subject: [PATCH 112/126] Added modern theme --- themes/modern/modern.theme.bash | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 themes/modern/modern.theme.bash diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash new file mode 100644 index 00000000..85bcfe09 --- /dev/null +++ b/themes/modern/modern.theme.bash @@ -0,0 +1,27 @@ +SCM_THEME_PROMPT_PREFIX="" +SCM_THEME_PROMPT_SUFFIX="" + +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)[\W] +${bold_red}└─▪${normal} " + else + PS1="┌─$(modern_scm_prompt)[\W] +└─▪ " + fi +} + + + +PROMPT_COMMAND=prompt From e5536385777f1f18960a8d89868214521ceaef83 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 15:49:51 -0600 Subject: [PATCH 113/126] Added colors to 'modern' theme --- themes/modern/modern.theme.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash index 85bcfe09..8ba87156 100644 --- a/themes/modern/modern.theme.bash +++ b/themes/modern/modern.theme.bash @@ -1,6 +1,12 @@ 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 ] From 0a67e549cbdc5877c5f0ca39b7cde1e7f1f5447e Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 16:03:33 -0600 Subject: [PATCH 114/126] Added more colors to 'modern' theme --- themes/modern/modern.theme.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash index 8ba87156..2d0948ff 100644 --- a/themes/modern/modern.theme.bash +++ b/themes/modern/modern.theme.bash @@ -20,10 +20,10 @@ modern_scm_prompt() { prompt() { if [ $? -ne 0 ] then - PS1="${bold_red}┌─${reset_color}$(modern_scm_prompt)[\W] + PS1="${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}] ${bold_red}└─▪${normal} " else - PS1="┌─$(modern_scm_prompt)[\W] + PS1="┌─$(modern_scm_prompt)[${cyan}\W${normal}] └─▪ " fi } From ad996f0a9313ba58014840eda3d4c8b74ae47f90 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 16:49:45 -0600 Subject: [PATCH 115/126] Added 'ref' plugin --- plugins/ref.plugin.bash | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/ref.plugin.bash diff --git a/plugins/ref.plugin.bash b/plugins/ref.plugin.bash new file mode 100644 index 00000000..0c93d706 --- /dev/null +++ b/plugins/ref.plugin.bash @@ -0,0 +1,36 @@ +ref() { + if [ ! -d "$REF_DIR" ] + then + mkdir -p "$REF_DIR" + fi + + REF_DIR=${REF_DIR%/} + + if [ "$1" = 'ls' ] + then + if [ "$2" = '' ] + then + builtin cd "$REF_DIR" + ls -G + builtin cd - > /dev/null + return + else + builtin cd "$REF_DIR"/"$2" + ls -G + builtin cd - > /dev/null + return + fi + fi + + DIR="${1}/${2}" + + builtin cd "$REF_DIR"/"$DIR" + + if [ $(uname) = "Darwin" ] + then + open index.html + elif [ $(uname) = "Linux" ] + then + gnome-open index.html + fi +} From 9448e355cabf4bbcc4d7aca4f54dfb76b3bf915a Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 16:49:58 -0600 Subject: [PATCH 116/126] Added REF_DIR variable for the ref plugin --- template/bash_profile.template.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 17853b1a..441e06ba 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -50,5 +50,8 @@ export TODO="t" # Set store directory for handmade commandline history tool export hchtstoredir="$HOME/.hcht" +# Set this to the directory to use for the ref plugin +export REF_DIR="$HOME/.ref/" + # Load Bash It source $BASH/bash_it.sh From 493bdb9456bd4ee375e5c9ce6bbd7317ed1a319d Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 17:01:19 -0600 Subject: [PATCH 117/126] Added documentation for ref plugin --- plugins/ref.plugin.bash | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/plugins/ref.plugin.bash b/plugins/ref.plugin.bash index 0c93d706..d5888db8 100644 --- a/plugins/ref.plugin.bash +++ b/plugins/ref.plugin.bash @@ -1,3 +1,27 @@ +##################################################################################################################################################################### +# README # +# ------ # +# # +# ref is a plugin for storing HTML formatted references, mainly suited for programming. # +# Your $REF_DIR variable is the directory for storing these references in. If it does not exist, it will be created automatically. # +# Here is an example of what my $REF_DIR looks like, because this will be of use when I explain how your $REF_DIR has to be structured: # +# # +# ~/.ref/ # +# ruby/ # +# general/ # +# index.html # +# bash/ # +# array/ # +# index.html # +# select/ # +# index.html # +# # +# This is what the basic structure of your $REF_DIR should look like: Subdirectories for each subject, and then another set of subdirectories for the part of the # +# subject you want to reference. And in the second subdirectory, an index.html file. # +# # +# I hope that you like this plugin and if you have any questions about it, send me (mrman208) a message on GitHub or email me at mrman208@me.com # +##################################################################################################################################################################### + ref() { if [ ! -d "$REF_DIR" ] then From 862c6438f4659c3755c0a4d64f17e0e15d129cae Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 17:06:04 -0600 Subject: [PATCH 118/126] Improved ref documentation --- plugins/ref.plugin.bash | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/ref.plugin.bash b/plugins/ref.plugin.bash index d5888db8..34f744c0 100644 --- a/plugins/ref.plugin.bash +++ b/plugins/ref.plugin.bash @@ -18,6 +18,29 @@ # # # This is what the basic structure of your $REF_DIR should look like: Subdirectories for each subject, and then another set of subdirectories for the part of the # # subject you want to reference. And in the second subdirectory, an index.html file. # +# +# To use ref, you do the ref command followed by the sugject and the sub-subject as arguments. For instance: +# +# ref bash array +# +# Would open the bash/array/index.html file. +# +# To list your references, you would do the ref ls command, optionally followed by a subject. For instance: +# +# ref ls +# +# Would give me: +# +# ruby bash +# +# And: +# +# ref ls bash +# +# would output: +# +# array +# select # # # I hope that you like this plugin and if you have any questions about it, send me (mrman208) a message on GitHub or email me at mrman208@me.com # ##################################################################################################################################################################### From db8d567b14fff4670727573cf7ce7d658bd179a0 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 17:08:33 -0600 Subject: [PATCH 119/126] Formatting fixes --- plugins/ref.plugin.bash | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/plugins/ref.plugin.bash b/plugins/ref.plugin.bash index 34f744c0..4f9ce26c 100644 --- a/plugins/ref.plugin.bash +++ b/plugins/ref.plugin.bash @@ -1,23 +1,23 @@ ##################################################################################################################################################################### -# README # -# ------ # -# # -# ref is a plugin for storing HTML formatted references, mainly suited for programming. # -# Your $REF_DIR variable is the directory for storing these references in. If it does not exist, it will be created automatically. # -# Here is an example of what my $REF_DIR looks like, because this will be of use when I explain how your $REF_DIR has to be structured: # -# # -# ~/.ref/ # -# ruby/ # -# general/ # -# index.html # -# bash/ # -# array/ # -# index.html # -# select/ # -# index.html # -# # -# This is what the basic structure of your $REF_DIR should look like: Subdirectories for each subject, and then another set of subdirectories for the part of the # -# subject you want to reference. And in the second subdirectory, an index.html file. # +# README +# ------ +# +# ref is a plugin for storing HTML formatted references, mainly suited for programming. +# Your $REF_DIR variable is the directory for storing these references in. If it does not exist, it will be created automatically. +# Here is an example of what my $REF_DIR looks like, because this will be of use when I explain how your $REF_DIR has to be structured: +# +# ~/.ref/ +# ruby/ +# general/ +# index.html +# bash/ +# array/ +# index.html +# select/ +# index.html +# +# This is what the basic structure of your $REF_DIR should look like: Subdirectories for each subject, and then another set of subdirectories for the part of the +# subject you want to reference. And in the second subdirectory, an index.html file. # # To use ref, you do the ref command followed by the sugject and the sub-subject as arguments. For instance: # @@ -41,8 +41,8 @@ # # array # select -# # -# I hope that you like this plugin and if you have any questions about it, send me (mrman208) a message on GitHub or email me at mrman208@me.com # +# +# I hope that you like this plugin and if you have any questions about it, send me (mrman208) a message on GitHub or email me at mrman208@me.com ##################################################################################################################################################################### ref() { From 145886305cd24fc61f32a8e4ea583eddf8cbbdac Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 20:50:57 -0600 Subject: [PATCH 120/126] Added 'new' command for ref. --- plugins/ref.plugin.bash | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/ref.plugin.bash b/plugins/ref.plugin.bash index 4f9ce26c..ed6329a2 100644 --- a/plugins/ref.plugin.bash +++ b/plugins/ref.plugin.bash @@ -41,8 +41,6 @@ # # array # select -# -# I hope that you like this plugin and if you have any questions about it, send me (mrman208) a message on GitHub or email me at mrman208@me.com ##################################################################################################################################################################### ref() { @@ -53,20 +51,26 @@ ref() { REF_DIR=${REF_DIR%/} + builtin cd $REF_DIR + if [ "$1" = 'ls' ] then if [ "$2" = '' ] then - builtin cd "$REF_DIR" ls -G builtin cd - > /dev/null return else - builtin cd "$REF_DIR"/"$2" ls -G builtin cd - > /dev/null return fi + elif [ "$1" = 'new' ] + then + mkdir -p "$2"/"$3" + echo You can now put the index.html file into "$REF_DIR"/"$2"/"$3" + builtin cd - > /dev/null + return fi DIR="${1}/${2}" From c82285539b031516cef21b1c01722a223e475524 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 21:12:45 -0600 Subject: [PATCH 121/126] Added better documentation for ref --- bash_it.sh | 1 + plugins/ref.plugin.bash | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/bash_it.sh b/bash_it.sh index f0c850c2..fef85847 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -69,5 +69,6 @@ function bash-it() { 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 " ref-help Get help for the ref plugin." echo } diff --git a/plugins/ref.plugin.bash b/plugins/ref.plugin.bash index ed6329a2..1c4deb0b 100644 --- a/plugins/ref.plugin.bash +++ b/plugins/ref.plugin.bash @@ -85,3 +85,25 @@ ref() { gnome-open index.html fi } + +ref-help() { + echo + echo "Help for the ref plugin" + echo "-----------------------" + echo + echo "Setting up: " + echo + echo "First, set the REF_DIR variable in you ~/.bash_profile to the directory you want to store your references in." + echo "You don't even have to create this directory if you don't want to, ref will make it for you if it doesn't exist." + echo + echo "Then, you can start adding some refs. You can do so with this command: " + echo " ref new topic subtopic" + echo "Where topic is the general topic, such as ruby. And subtopic is a more exact topic, like array." + echo "This will create a directory for the topic, and a subdirectory for the subtopic. You can then move a file of your desired format into the subtopic's directory." + echo + echo "To access your ref, you would do the following command: " + echo " ref topic subtopic" + echo "Where topic and subtopic are the same as before, but ref will open the file under your topic/subtopic directory. Unless it is a full website." + echo + echo "You can also download full websites as a ref, as long as it has an index.html file, it will work." +} From 668f8e68c068e92035476c2052ff9fe9431c3336 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 5 Dec 2010 21:15:30 -0600 Subject: [PATCH 122/126] Added PS2 to modern theme --- themes/modern/modern.theme.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash index 2d0948ff..f0dbccce 100644 --- a/themes/modern/modern.theme.bash +++ b/themes/modern/modern.theme.bash @@ -28,6 +28,8 @@ ${bold_red}└─▪${normal} " fi } +PS2="└─▪ " + PROMPT_COMMAND=prompt From 13edf326c450548e14673c82f75c717425d19a8b Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Mon, 6 Dec 2010 16:01:06 +0100 Subject: [PATCH 123/126] added advanced ssh completion --- completion/ssh.completion.bash | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/completion/ssh.completion.bash b/completion/ssh.completion.bash index 76913330..30fd65d6 100644 --- a/completion/ssh.completion.bash +++ b/completion/ssh.completion.bash @@ -4,10 +4,20 @@ export COMP_WORDBREAKS=${COMP_WORDBREAKS/\:/} _sshcomplete() { - if [ -f $HOME/.ssh/config ]; then - COMPREPLY=($(compgen -W "`ruby -e"puts open('${HOME}/.ssh/config', 'r') { |f| f.readlines }.find_all { |l| l =~ /^Host/ }.inject([]) { |hosts, line| hosts << line[5..-1].split }.flatten.sort.uniq"`" -- ${COMP_WORDS[COMP_CWORD]})) - return 0 + + # 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 From afafe316b59fbf69f0feccb029f4d375d5e58d4e Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 6 Dec 2010 16:10:56 -0600 Subject: [PATCH 124/126] Removed all traces of ref because I am going to be making it into a separate project. --- bash_it.sh | 1 - plugins/ref.plugin.bash | 109 ---------------------------------------- 2 files changed, 110 deletions(-) delete mode 100644 plugins/ref.plugin.bash diff --git a/bash_it.sh b/bash_it.sh index fef85847..f0c850c2 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -69,6 +69,5 @@ function bash-it() { 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 " ref-help Get help for the ref plugin." echo } diff --git a/plugins/ref.plugin.bash b/plugins/ref.plugin.bash deleted file mode 100644 index 1c4deb0b..00000000 --- a/plugins/ref.plugin.bash +++ /dev/null @@ -1,109 +0,0 @@ -##################################################################################################################################################################### -# README -# ------ -# -# ref is a plugin for storing HTML formatted references, mainly suited for programming. -# Your $REF_DIR variable is the directory for storing these references in. If it does not exist, it will be created automatically. -# Here is an example of what my $REF_DIR looks like, because this will be of use when I explain how your $REF_DIR has to be structured: -# -# ~/.ref/ -# ruby/ -# general/ -# index.html -# bash/ -# array/ -# index.html -# select/ -# index.html -# -# This is what the basic structure of your $REF_DIR should look like: Subdirectories for each subject, and then another set of subdirectories for the part of the -# subject you want to reference. And in the second subdirectory, an index.html file. -# -# To use ref, you do the ref command followed by the sugject and the sub-subject as arguments. For instance: -# -# ref bash array -# -# Would open the bash/array/index.html file. -# -# To list your references, you would do the ref ls command, optionally followed by a subject. For instance: -# -# ref ls -# -# Would give me: -# -# ruby bash -# -# And: -# -# ref ls bash -# -# would output: -# -# array -# select -##################################################################################################################################################################### - -ref() { - if [ ! -d "$REF_DIR" ] - then - mkdir -p "$REF_DIR" - fi - - REF_DIR=${REF_DIR%/} - - builtin cd $REF_DIR - - if [ "$1" = 'ls' ] - then - if [ "$2" = '' ] - then - ls -G - builtin cd - > /dev/null - return - else - ls -G - builtin cd - > /dev/null - return - fi - elif [ "$1" = 'new' ] - then - mkdir -p "$2"/"$3" - echo You can now put the index.html file into "$REF_DIR"/"$2"/"$3" - builtin cd - > /dev/null - return - fi - - DIR="${1}/${2}" - - builtin cd "$REF_DIR"/"$DIR" - - if [ $(uname) = "Darwin" ] - then - open index.html - elif [ $(uname) = "Linux" ] - then - gnome-open index.html - fi -} - -ref-help() { - echo - echo "Help for the ref plugin" - echo "-----------------------" - echo - echo "Setting up: " - echo - echo "First, set the REF_DIR variable in you ~/.bash_profile to the directory you want to store your references in." - echo "You don't even have to create this directory if you don't want to, ref will make it for you if it doesn't exist." - echo - echo "Then, you can start adding some refs. You can do so with this command: " - echo " ref new topic subtopic" - echo "Where topic is the general topic, such as ruby. And subtopic is a more exact topic, like array." - echo "This will create a directory for the topic, and a subdirectory for the subtopic. You can then move a file of your desired format into the subtopic's directory." - echo - echo "To access your ref, you would do the following command: " - echo " ref topic subtopic" - echo "Where topic and subtopic are the same as before, but ref will open the file under your topic/subtopic directory. Unless it is a full website." - echo - echo "You can also download full websites as a ref, as long as it has an index.html file, it will work." -} From 8d3cd22c541ade83e47c5b5d62606f5a7ffd5e4b Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Mon, 6 Dec 2010 16:20:36 -0600 Subject: [PATCH 125/126] Removed REF_DIR variable from .bash_profile template. --- template/bash_profile.template.bash | 3 --- 1 file changed, 3 deletions(-) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 441e06ba..17853b1a 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -50,8 +50,5 @@ export TODO="t" # Set store directory for handmade commandline history tool export hchtstoredir="$HOME/.hcht" -# Set this to the directory to use for the ref plugin -export REF_DIR="$HOME/.ref/" - # Load Bash It source $BASH/bash_it.sh From 0d55346e9b19a9ccf87a3ba317e68054c6fc7391 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Mon, 6 Dec 2010 22:08:32 -0500 Subject: [PATCH 126/126] Didn't see the instructions to add myself to `README.md`. My pull request (#23) was accepted in 6c975853292f6d897c871c51149a63ec62abd0b6 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e305eb8d..e7537243 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ If you are submitting a pull request, please add your name to the list. * [Mark Szymanski][mrman208] * [Florian Baumann][noqqe] * [Andy Shen][shenie] +* [John Schulz][jfsiii] [revans]: http://github.com/revans [zerobearing2]: http://github.com/zerobearing2 @@ -64,4 +65,5 @@ If you are submitting a pull request, please add your name to the list. [mrman208]: http://github.com/mrman208 [noqqe]: http://github.com/noqqe [shenie]: http://github.com/shenie +[jfsiii]: http://github.com/jfsiii