From 11b595516167927b70d182ab8d38257c9e86cfc3 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 16:13:34 -0400 Subject: [PATCH 01/28] Revert "move garb into git plugins; rename newpost as jknewpost" This reverts commit d22a4cfa7058b224e37dbf07aa7cd3c583fdd188. --- aliases/available/git.aliases.bash | 7 +++++++ plugins/available/git.plugins.bash | 8 +------- plugins/available/jekyll.plugins.bash | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/aliases/available/git.aliases.bash b/aliases/available/git.aliases.bash index 7cfc9d93..3a5d2a9f 100644 --- a/aliases/available/git.aliases.bash +++ b/aliases/available/git.aliases.bash @@ -39,6 +39,13 @@ case $OSTYPE in ;; esac +# git add remote branch +function garb() { + echo "Adding remote branch '$1'"; + git config branch.$1.remote origin; + git config branch.$1.merge refs/heads/$1; +} + function git-help() { echo "Git Custom Aliases Usage" echo diff --git a/plugins/available/git.plugins.bash b/plugins/available/git.plugins.bash index 3fbdac61..b0b9ce8c 100644 --- a/plugins/available/git.plugins.bash +++ b/plugins/available/git.plugins.bash @@ -5,13 +5,6 @@ function git_remote { git remote add origin $GIT_HOSTING:$1.git } -# git add remote branch -function garb() { - echo "Adding remote branch '$1'"; - git config branch.$1.remote origin; - git config branch.$1.merge refs/heads/$1; -} - function git_first_push { echo "Running: git push origin master:refs/heads/master" git push origin master:refs/heads/master @@ -99,3 +92,4 @@ else echo "you're currently not in a git repository" fi } + diff --git a/plugins/available/jekyll.plugins.bash b/plugins/available/jekyll.plugins.bash index 3b96f451..aebe69bc 100644 --- a/plugins/available/jekyll.plugins.bash +++ b/plugins/available/jekyll.plugins.bash @@ -26,7 +26,7 @@ editpost() { fi } -jknewpost() { +newpost() { # 'builtin cd' into the local jekyll root From 4a8e08e7832fe4480ca4bf9db7a7778dc0478400 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 16:13:59 -0400 Subject: [PATCH 02/28] Revert "Add various aliases" This reverts commit 3ef689f29a777f8a076b4a7032ca46f4ba331106. --- aliases/available/general.aliases.bash | 9 --------- aliases/available/git.aliases.bash | 7 +------ aliases/available/jekyll.aliases.bash | 3 --- aliases/available/osx.aliases.bash | 1 - 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/aliases/available/general.aliases.bash b/aliases/available/general.aliases.bash index 2ed9d134..79bd7aa0 100644 --- a/aliases/available/general.aliases.bash +++ b/aliases/available/general.aliases.bash @@ -46,15 +46,6 @@ alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'" alias md='mkdir -p' alias rd=rmdir -# show / hide hidden files -alias showhidden="defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder" -alias hidehidden="defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder" -# display IP address -alias myip="echo ethernet:; ipconfig getifaddr en0; echo wireless:; ipconfig getifaddr en1" - -# http://snippets.dzone.com/posts/show/2486 -alias killsvn="find . -name ".svn" -type d -exec rm -rf {} \;" - function aliases-help() { echo "Generic Alias Usage" echo diff --git a/aliases/available/git.aliases.bash b/aliases/available/git.aliases.bash index 3a5d2a9f..45d7d05f 100644 --- a/aliases/available/git.aliases.bash +++ b/aliases/available/git.aliases.bash @@ -39,12 +39,7 @@ case $OSTYPE in ;; esac -# git add remote branch -function garb() { - echo "Adding remote branch '$1'"; - git config branch.$1.remote origin; - git config branch.$1.merge refs/heads/$1; -} + function git-help() { echo "Git Custom Aliases Usage" diff --git a/aliases/available/jekyll.aliases.bash b/aliases/available/jekyll.aliases.bash index feaf245a..e52c0351 100644 --- a/aliases/available/jekyll.aliases.bash +++ b/aliases/available/jekyll.aliases.bash @@ -18,6 +18,3 @@ alias buildsite="builtin cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" # Rsync the site to the remote server alias deploysite="builtin cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT" - -alias jkas="jekyll --auto --server" -alias rmjkas="rm -rf _site/* && jkas" \ No newline at end of file diff --git a/aliases/available/osx.aliases.bash b/aliases/available/osx.aliases.bash index d25c0511..e0746952 100644 --- a/aliases/available/osx.aliases.bash +++ b/aliases/available/osx.aliases.bash @@ -14,7 +14,6 @@ alias dashcode="open -a dashcode" alias f='open -a Finder ' alias textedit='open -a TextEdit' alias hex='open -a "Hex Fiend"' -alias gitx="open -a GitX" if [ -s /usr/bin/firefox ] ; then unalias firefox From e115b4c5af234558e062a1ccd9c0db8d91402a60 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Tue, 21 Jun 2011 09:20:40 -0500 Subject: [PATCH 03/28] Move auto-complete code over to available -> enabled style This continues the move toward the ability to turn things off with everything turned on by default. --- bash_it.sh | 8 +++++++- completion/{ => available}/brew.completion.bash | 0 completion/{ => available}/git.completion.bash | 0 completion/{ => available}/git_flow.completion.bash | 0 completion/{ => available}/rake.completion.bash | 0 completion/{ => available}/ssh.completion.bash | 0 completion/{ => available}/todo.completion.bash | 0 7 files changed, 7 insertions(+), 1 deletion(-) rename completion/{ => available}/brew.completion.bash (100%) rename completion/{ => available}/git.completion.bash (100%) rename completion/{ => available}/git_flow.completion.bash (100%) rename completion/{ => available}/rake.completion.bash (100%) rename completion/{ => available}/ssh.completion.bash (100%) rename completion/{ => available}/todo.completion.bash (100%) diff --git a/bash_it.sh b/bash_it.sh index b52ff97f..68f3884d 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -17,8 +17,14 @@ do source $config_file done +# TODO: reduce the repetition here by combining these three into a loop # Tab Completion -COMPLETION="${BASH}/completion/*.bash" +if [ ! -d "${BASH}/completion/enabled" ] +then + mkdir "${BASH}/completion/enabled" + ln -s ${BASH}/completion/available/* "${BASH}/completion/enabled" +fi +COMPLETION="${BASH}/completion/enabled/*.bash" for config_file in $COMPLETION do source $config_file diff --git a/completion/brew.completion.bash b/completion/available/brew.completion.bash similarity index 100% rename from completion/brew.completion.bash rename to completion/available/brew.completion.bash diff --git a/completion/git.completion.bash b/completion/available/git.completion.bash similarity index 100% rename from completion/git.completion.bash rename to completion/available/git.completion.bash diff --git a/completion/git_flow.completion.bash b/completion/available/git_flow.completion.bash similarity index 100% rename from completion/git_flow.completion.bash rename to completion/available/git_flow.completion.bash diff --git a/completion/rake.completion.bash b/completion/available/rake.completion.bash similarity index 100% rename from completion/rake.completion.bash rename to completion/available/rake.completion.bash diff --git a/completion/ssh.completion.bash b/completion/available/ssh.completion.bash similarity index 100% rename from completion/ssh.completion.bash rename to completion/available/ssh.completion.bash diff --git a/completion/todo.completion.bash b/completion/available/todo.completion.bash similarity index 100% rename from completion/todo.completion.bash rename to completion/available/todo.completion.bash From 1f0594b7d1e3fb948f53e76ade95e17f729b8804 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Tue, 21 Jun 2011 09:22:24 -0500 Subject: [PATCH 04/28] update to ignore all "enabled" files --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 33e5fca9..32e62dec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -aliases/enabled -plugins/enabled +*/enabled/* .DS_Store custom/*.bash !custom/example.bash From d7cfa8b394dcd652e6b1656e22d69ac235d104b0 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Tue, 21 Jun 2011 09:31:26 -0500 Subject: [PATCH 05/28] Switch to single loop now that all directory use the same pattern Simple refactoring -- now there's no need to source each one independently. --- bash_it.sh | 47 +++++++++++++---------------------------------- 1 file changed, 13 insertions(+), 34 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index 68f3884d..a030069e 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -17,43 +17,22 @@ do source $config_file done -# TODO: reduce the repetition here by combining these three into a loop -# Tab Completion -if [ ! -d "${BASH}/completion/enabled" ] -then - mkdir "${BASH}/completion/enabled" - ln -s ${BASH}/completion/available/* "${BASH}/completion/enabled" -fi -COMPLETION="${BASH}/completion/enabled/*.bash" -for config_file in $COMPLETION +# Load enabled aliases, completion, plugins +for file_type in "aliases" "completion" "plugins" do - source $config_file -done - -# Plugins -if [ ! -d "${BASH}/plugins/enabled" ] -then - mkdir "${BASH}/plugins/enabled" - ln -s ${BASH}/plugins/available/* "${BASH}/plugins/enabled" -fi -PLUGINS="${BASH}/plugins/enabled/*.bash" -for config_file in $PLUGINS -do - source $config_file -done - -# Aliases -if [ ! -d "${BASH}/aliases/enabled" ] -then - mkdir "${BASH}/aliases/enabled" - ln -s ${BASH}/aliases/available/* "${BASH}/aliases/enabled" -fi -FUNCTIONS="${BASH}/aliases/enabled/*.bash" -for config_file in $FUNCTIONS -do - source $config_file + if [ ! -d "${BASH}/${file_type}/enabled" ] + then + mkdir "${BASH}/${file_type}/enabled" + ln -s ${BASH}/${file_type}/available/* "${BASH}/${file_type}/enabled" + fi + FILES="${BASH}/${file_type}/enabled/*.bash" + for config_file in $FILES + do + source $config_file + done done +# Load any custom aliases that the user has added if [ -e "${BASH}/aliases/custom.aliases.bash" ] then source "${BASH}/aliases/custom.aliases.bash" From b36d86ddff8f83c691e761d1f9a9789ca8d52fbd Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 11:36:11 -0500 Subject: [PATCH 06/28] Add minimal-git theme Just like the minimal theme, but with git info --- themes/minimal-git/minimal-git.theme.bash | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 themes/minimal-git/minimal-git.theme.bash diff --git a/themes/minimal-git/minimal-git.theme.bash b/themes/minimal-git/minimal-git.theme.bash new file mode 100644 index 00000000..1862f7ff --- /dev/null +++ b/themes/minimal-git/minimal-git.theme.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +SCM_THEME_PROMPT_PREFIX="${cyan}(${green}" +SCM_THEME_PROMPT_SUFFIX="${cyan})" +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" + +PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " From 989de733309ef79308b3806268ad35467f7ee9b8 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 12:06:30 -0500 Subject: [PATCH 07/28] No more bold --- themes/minimal-git/minimal-git.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/minimal-git/minimal-git.theme.bash b/themes/minimal-git/minimal-git.theme.bash index 1862f7ff..b4c34627 100644 --- a/themes/minimal-git/minimal-git.theme.bash +++ b/themes/minimal-git/minimal-git.theme.bash @@ -3,6 +3,6 @@ SCM_THEME_PROMPT_PREFIX="${cyan}(${green}" SCM_THEME_PROMPT_SUFFIX="${cyan})" SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓" +SCM_THEME_PROMPT_CLEAN=" ${green}✓" PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " From 4e14eefca83e7386e02aa1013b11353583c5a134 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 12:08:36 -0500 Subject: [PATCH 08/28] Works now --- themes/minimal-git/minimal-git.theme.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/themes/minimal-git/minimal-git.theme.bash b/themes/minimal-git/minimal-git.theme.bash index b4c34627..76cb24d5 100644 --- a/themes/minimal-git/minimal-git.theme.bash +++ b/themes/minimal-git/minimal-git.theme.bash @@ -5,4 +5,8 @@ SCM_THEME_PROMPT_SUFFIX="${cyan})" SCM_THEME_PROMPT_DIRTY=" ${red}✗" SCM_THEME_PROMPT_CLEAN=" ${green}✓" -PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " +prompt() { + PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " +} + +PROMPT_COMMAND=prompt From 5af99be158656bbcb5f4d56fb799e3313837bb53 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 17:45:13 -0500 Subject: [PATCH 09/28] Get rid of old jekyll aliases --- aliases/available/jekyll.aliases.bash | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 aliases/available/jekyll.aliases.bash diff --git a/aliases/available/jekyll.aliases.bash b/aliases/available/jekyll.aliases.bash deleted file mode 100644 index e52c0351..00000000 --- a/aliases/available/jekyll.aliases.bash +++ /dev/null @@ -1,20 +0,0 @@ -# Open the root of your site in your vim or builtin cd to it - -if [[ $EDITOR = "vim" ]] -then - alias newentry="builtin cd $JEKYLL_LOCAL_ROOT && $EDITOR ." -else - alias newentry="builtin cd $JEKYLL_LOCAL_ROOT" -fi - -# Build and locally serve the site - -alias testsite="builtin cd $JEKYLL_LOCAL_ROOT && jekyll --server --auto" - -# Build but don't locally serve the site - -alias buildsite="builtin cd $JEKYLL_LOCAL_ROOT && rm -rf _site/ && jekyll" - -# Rsync the site to the remote server - -alias deploysite="builtin cd $JEKYLL_LOCAL_ROOT && rsync -rz _site/ $JEKYLL_REMOTE_ROOT" From 10ac7731703eaeecc9b4fb3d7e601569cbe5c980 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 17:45:37 -0500 Subject: [PATCH 10/28] Get rid of old, unneeded jekyll config stuff --- template/bash_profile.template.bash | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 30ab0fc1..95f481e9 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -26,18 +26,6 @@ export NGINX_PATH='/opt/nginx' # Don't check mail when opening terminal. unset MAILCHECK -# Change this to the path of your local jekyll root to use the jekyll aliases - -export JEKYLL_LOCAL_ROOT="$HOME/Sites/jekyllsite" - -# And change this to the remote server and root - -export JEKYLL_REMOTE_ROOT="user@server:/path/to/jekyll/root" - -# And, for the last of the jekyll variables, this is the formatting you use, eg: markdown, -# textile, etc. Basically whatever you use as the extension for posts, without the preceding dot - -export JEKYLL_FORMATTING="markdown" # Change this to your console based IRC client of choice. From 56b83c76cbc1b8d257103982563a6690e36068a0 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 17:45:55 -0500 Subject: [PATCH 11/28] Add new jekyll config stuff --- template/jekyllconfig.template.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 template/jekyllconfig.template.bash diff --git a/template/jekyllconfig.template.bash b/template/jekyllconfig.template.bash new file mode 100644 index 00000000..e4705181 --- /dev/null +++ b/template/jekyllconfig.template.bash @@ -0,0 +1,17 @@ +# This is a space-delimited list of your Jekyll project paths + +SITES="$HOME/sites/project_1 $HOME/sites/project_2" + +# This is another space-delimited list. +# This one is of the remote user@host:path location of your jekyll site +# NOTE: The locations of these must correspond to the locations +# of the sites in the first list +# For instance, the host for the first Jekyll site +# must be first in this list, the second second, etc. + +REMOTES="user@host_1:path user@host_2:path" + +# list of markup syntaxes to use for the sites, +# Same rules as above. Can be HTML, textile, or markdown + +MARKUPS="markdown textile" From 9ad7964c861504d9ef030dd11742d5dc00e4320a Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 17:49:19 -0500 Subject: [PATCH 12/28] Add support for multiple Jekyll sites --- bash_it.sh | 7 + plugins/available/jekyll.plugins.bash | 448 +++++++++++++++++--------- 2 files changed, 300 insertions(+), 155 deletions(-) diff --git a/bash_it.sh b/bash_it.sh index a030069e..7734c10c 100644 --- a/bash_it.sh +++ b/bash_it.sh @@ -56,6 +56,13 @@ PREVIEW="less" [ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" [ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" +# Load all the Jekyll stuff + +if [ -e $HOME/.jekyllconfig ] +then + . $HOME/.jekyllconfig +fi + # # Custom Help diff --git a/plugins/available/jekyll.plugins.bash b/plugins/available/jekyll.plugins.bash index aebe69bc..8efdd11f 100644 --- a/plugins/available/jekyll.plugins.bash +++ b/plugins/available/jekyll.plugins.bash @@ -1,208 +1,346 @@ #!/bin/bash editpost() { - builtin cd "$JEKYLL_LOCAL_ROOT/_posts" + unset SITE + if [ -z "$1" ] + then + echo "Error: no site specified." + echo "The site is the name of the directory your project is in." + return 1 + fi - COUNTER=1 - NUMBER="$RANDOM" - TMPFILE="/tmp/editpost-$NUMBER" + for site in ${SITES[@]} + do + if [ "$(basename $site)" = "$1" ] + then + SITE=$site + break + fi + done - for POST in * - do - DATE=`echo $POST | grep -oE "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}"` - TITLE=`cat $POST | grep -oE "title: (.+)"` - TITLE=`echo $TITLE | sed 's/title: //'` - echo "$COUNTER) $DATE $TITLE" >> "$TMPFILE" - POSTS[$COUNTER]=$POST - COUNTER=`expr $COUNTER + 1` - done - less $TMPFILE - read -p "Number of post to edit: " POST_TO_EDIT - if [ -z "$EDITOR" ] - then - nano "${POSTS[$POST_TO_EDIT]}" - else - "$EDITOR" "${POSTS[$POST_TO_EDIT]}" - fi + if [ -z "$SITE" ] + then + echo "No such site." + return 1 + fi + + builtin cd "$SITE/_posts" + + COUNTER=1 + NUMBER="$RANDOM" + TMPFILE="/tmp/editpost-$NUMBER" + + for POST in * + do + DATE=`echo $POST | grep -oE "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}"` + TITLE=`cat $POST | grep -oE "title: (.+)"` + TITLE=`echo $TITLE | sed 's/title: //'` + echo "$COUNTER) $DATE $TITLE" >> "$TMPFILE" + POSTS[$COUNTER]=$POST + COUNTER=`expr $COUNTER + 1` + done + less $TMPFILE + read -p "Number of post to edit: " POST_TO_EDIT + if [ -z "$EDITOR" ] + then + nano "${POSTS[$POST_TO_EDIT]}" + else + "$EDITOR" "${POSTS[$POST_TO_EDIT]}" + fi } newpost() { + unset SITE + if [ -z "$1" ] + then + echo "Error: no site specified." + echo "The site is the name of the directory your project is in." + return 1 + fi - # 'builtin cd' into the local jekyll root + if [ -z "$SITE" ] + then + echo "No such site." + return 1 + fi - builtin cd "$JEKYLL_LOCAL_ROOT/_posts" + loc=0 - # Get the date for the new post's filename + for site in ${SITES[@]} + do + if [ "$(basename $site)" = "$1" ] + then + SITE=$site + JEKYLL_FORMATTING=${MARKUPS[$loc]} + break + fi + loc=$(($loc+1)) + done - FNAME_DATE=$(date "+%Y-%m-%d") + # 'builtin cd' into the local jekyll root - # If the user is using markdown formatting, let them choose what type of post they want. Sort of like Tumblr. + builtin cd "$SITE/_posts" - OPTIONS="Text Quote Image Audio Video Link" - - if [ $JEKYLL_FORMATTING = "markdown" -o $JEKYLL_FORMATTING = "textile" ] - then - select OPTION in $OPTIONS - do - if [[ $OPTION = "Text" ]] - then - POST_TYPE="Text" - break - fi + # Get the date for the new post's filename - if [[ $OPTION = "Quote" ]] - then - POST_TYPE="Quote" - break - fi - - if [[ $OPTION = "Image" ]] - then - POST_TYPE="Image" - break - fi + FNAME_DATE=$(date "+%Y-%m-%d") - if [[ $OPTION = "Audio" ]] - then - POST_TYPE="Audio" - break - fi + # If the user is using markdown or textile formatting, let them choose what type of post they want. Sort of like Tumblr. - if [[ $OPTION = "Video" ]] - then - POST_TYPE="Video" - break - fi + OPTIONS="Text Quote Image Audio Video Link" - if [[ $OPTION = "Link" ]] - then - POST_TYPE="Link" - break - fi - done - fi + if [ $JEKYLL_FORMATTING = "markdown" -o $JEKYLL_FORMATTING = "textile" ] + then + select OPTION in $OPTIONS + do + if [[ $OPTION = "Text" ]] + then + POST_TYPE="Text" + break + fi - # Get the title for the new post + if [[ $OPTION = "Quote" ]] + then + POST_TYPE="Quote" + break + fi - read -p "Enter title of the new post: " POST_TITLE + if [[ $OPTION = "Image" ]] + then + POST_TYPE="Image" + break + fi - # Convert the spaces in the title to hyphens for use in the filename + if [[ $OPTION = "Audio" ]] + then + POST_TYPE="Audio" + break + fi - FNAME_POST_TITLE=`echo $POST_TITLE | tr ' ' "-"` + if [[ $OPTION = "Video" ]] + then + POST_TYPE="Video" + break + fi - # Now, put it all together for the full filename + if [[ $OPTION = "Link" ]] + then + POST_TYPE="Link" + break + fi + done + fi - FNAME="$FNAME_DATE-$FNAME_POST_TITLE.$JEKYLL_FORMATTING" + # Get the title for the new post - # And, finally, create the actual post file. But we're not done yet... + read -p "Enter title of the new post: " POST_TITLE - touch "$FNAME" + # Convert the spaces in the title to hyphens for use in the filename - # Write a little stuff to the file for the YAML Front Matter + FNAME_POST_TITLE=`echo $POST_TITLE | tr ' ' "-"` - echo "---" >> $FNAME + # Now, put it all together for the full filename - # Now we have to get the date, again. But this time for in the header (YAML Front Matter) of - # the file + FNAME="$FNAME_DATE-$FNAME_POST_TITLE.$JEKYLL_FORMATTING" - YAML_DATE=$(date "+%B %d %Y %X") + # And, finally, create the actual post file. But we're not done yet... - # Echo the YAML Formatted date to the post file + touch "$FNAME" - echo "date: $YAML_DATE" >> $FNAME + # Write a little stuff to the file for the YAML Front Matter - # Echo the original post title to the YAML Front Matter header + echo "---" >> $FNAME - echo "title: $POST_TITLE" >> $FNAME + # Now we have to get the date, again. But this time for in the header (YAML Front Matter) of + # the file - # And, now, echo the "post" layout to the YAML Front Matter header + YAML_DATE=$(date "+%B %d %Y %X") - echo "layout: post" >> $FNAME + # Echo the YAML Formatted date to the post file - # Close the YAML Front Matter Header + echo "date: $YAML_DATE" >> $FNAME - echo "---" >> $FNAME - echo >> $FNAME + # Echo the original post title to the YAML Front Matter header - # Generate template text based on the post type + echo "title: $POST_TITLE" >> $FNAME - if [[ $JEKYLL_FORMATTING = "markdown" ]] - then - if [[ $POST_TYPE = "Text" ]] - then - true - fi + # And, now, echo the "post" layout to the YAML Front Matter header - if [[ $POST_TYPE = "Quote" ]] - then - echo "> Quote" >> $FNAME - echo >> $FNAME - echo "— Author" >> $FNAME - fi + echo "layout: post" >> $FNAME - if [[ $POST_TYPE = "Image" ]] - then - echo "![Alternate Text](/path/to/image/or/url)" >> $FNAME - fi + # Close the YAML Front Matter Header - if [[ $POST_TYPE = "Audio" ]] - then - echo "" >> $FNAME - fi + echo "---" >> $FNAME + echo >> $FNAME - if [[ $POST_TYPE = "Video" ]] - 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 + # Generate template text based on the post type - if [[ $JEKYLL_FORMATTING = "textile" ]] - then - if [[ $POST_TYPE = "Text" ]] - then - true - fi + if [[ $JEKYLL_FORMATTING = "markdown" ]] + 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 = "Quote" ]] + then + echo "> Quote" >> $FNAME + echo >> $FNAME + echo "— Author" >> $FNAME + fi - if [[ $POST_TYPE = "Image" ]] - then - echo "!url(alt text)" >> $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 - fi + if [[ $POST_TYPE = "Video" ]] + then + echo "" >> $FNAME + fi - if [[ $POST_TYPE = "Link" ]] - then - echo "\"Site\":url" >> $FNAME - echo >> $FNAME - echo "bq. Quote" >> $FNAME - fi - fi + if [[ $POST_TYPE = "Link" ]] + then + echo "[link][1]" >> $FNAME + echo >> $FNAME + echo "> Quote" >> $FNAME + echo >> $FNAME + echo "[1]: url" >> $FNAME + fi + fi - # Open the file in your favorite editor + if [[ $JEKYLL_FORMATTING = "textile" ]] + then + if [[ $POST_TYPE = "Text" ]] + then + true + fi - "$EDITOR" $FNAME + 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 + + if [[ $POST_TYPE = "Link" ]] + then + echo "\"Site\":url" >> $FNAME + echo >> $FNAME + echo "bq. Quote" >> $FNAME + fi + fi + + # Open the file in your favorite editor + + "$EDITOR" $FNAME +} + +function testsite() { + unset SITE + if [ -z "$1" ] + then + echo "Error: no site specified." + echo "The site is the name of the directory your project is in." + return 1 + fi + + for site in ${SITES[@]} + do + if [ "$(basename $site)" = "$1" ] + then + SITE=$site + break + fi + done + + if [ -z "$SITE" ] + then + echo "No such site." + return 1 + fi + + builtin cd $SITE + jekyll --server --auto +} + +function buildsite() { + unset SITE + if [ -z "$1" ] + then + echo "Error: no site specified." + echo "The site is the name of the directory your project is in." + return 1 + fi + + for site in ${SITES[@]} + do + if [ "$(basename $site)" = "$1" ] + then + SITE=$site + break + fi + done + + if [ -z "$SITE" ] + then + echo "No such site." + return 1 + fi + + builtin cd $SITE + rm -rf _site + jekyll --no-server +} + +function deploysite() { + unset SITE + if [ -z "$1" ] + then + echo "Error: no site specified." + echo "The site is the name of the directory your project is in." + return 1 + fi + + loc=0 + + for site in ${SITES[@]} + do + if [ "$(basename $site)" = "$1" ] + then + SITE=$site + REMOTE=${REMOTES[$loc]} + break + fi + loc=$(($loc+1)) + done + + if [ -z "$SITE" ] + then + echo "No such site." + return 1 + fi + + builtin cd $SITE + rsync -rz $REMOTE } From 4ac4049a7595e1d694e7283dba7714e5aff14569 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Fri, 24 Jun 2011 17:50:02 -0500 Subject: [PATCH 13/28] Add note for configuring Jekyll support --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c8412c92..5af3056e 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,14 @@ Check a clone of this repo. You can view what a sample `~/.bash_profile` looks l cp ~/.bash_profile ~/.bash_profile_original cp /template/bash_profile.template.bash ~/.bash_profile +To configure Jekyll support for bash it, move the +jekyllconfig.template.bash to your home directory: + + cp /template/jekyllconfig.template.bash ~/.jekyllconfig + +Be sure to edit this file to your needed specifications. Please note +that this file is *not* required. Only use it if you plan on using the +jekyll plugins. ## Help Screens From 6e8733ea98d09ca5d87f07a9e4a1b696b2a6fe0e Mon Sep 17 00:00:00 2001 From: Jeff Carouth Date: Sat, 25 Jun 2011 10:05:25 -0500 Subject: [PATCH 14/28] Adding multiple SCM support to doubletime theme. The doubletime theme improves the SCM status prompt for git. However, it accomplishes this at the expense of other SCM systems. This delegates prompt to the default bash-it prompt function when the SCM is not git. --- themes/doubletime/doubletime.theme.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/themes/doubletime/doubletime.theme.bash b/themes/doubletime/doubletime.theme.bash index 1237f80f..e16ba66c 100644 --- a/themes/doubletime/doubletime.theme.bash +++ b/themes/doubletime/doubletime.theme.bash @@ -17,11 +17,12 @@ fi doubletime_scm_prompt() { CHAR=$(scm_char) - if [ $CHAR = $SCM_NONE_CHAR ] - then + if [ $CHAR = $SCM_NONE_CHAR ]; then return - else + elif [ $CHAR = $SCM_GIT_CHAR ]; then echo "$(git_prompt_status)" + else + echo "[$(scm_prompt_info)]" fi } From ff0859d28966035e310277ef3e8701b1fe119d80 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 25 Jun 2011 11:50:56 -0500 Subject: [PATCH 15/28] Move minimal-git theme into minimal theme --- themes/minimal/minimal.theme.bash | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/themes/minimal/minimal.theme.bash b/themes/minimal/minimal.theme.bash index 8de4a6c7..76cb24d5 100644 --- a/themes/minimal/minimal.theme.bash +++ b/themes/minimal/minimal.theme.bash @@ -1,7 +1,12 @@ -prompt_setter() { - PS1="${cyan}\W${normal} " +#!/usr/bin/env bash + +SCM_THEME_PROMPT_PREFIX="${cyan}(${green}" +SCM_THEME_PROMPT_SUFFIX="${cyan})" +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${green}✓" + +prompt() { + PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " } -PROMPT_COMMAND=prompt_setter - -export PS3=">> " +PROMPT_COMMAND=prompt From 052da726df55cf7019b08f897d3d3dc1371d2d85 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 25 Jun 2011 11:52:50 -0500 Subject: [PATCH 16/28] Get rid of old minimal-git theme --- themes/minimal-git/minimal-git.theme.bash | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 themes/minimal-git/minimal-git.theme.bash diff --git a/themes/minimal-git/minimal-git.theme.bash b/themes/minimal-git/minimal-git.theme.bash deleted file mode 100644 index 76cb24d5..00000000 --- a/themes/minimal-git/minimal-git.theme.bash +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -SCM_THEME_PROMPT_PREFIX="${cyan}(${green}" -SCM_THEME_PROMPT_SUFFIX="${cyan})" -SCM_THEME_PROMPT_DIRTY=" ${red}✗" -SCM_THEME_PROMPT_CLEAN=" ${green}✓" - -prompt() { - PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " -} - -PROMPT_COMMAND=prompt From 93df02f19389151f9bc5f0420024605289081f63 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 26 Jun 2011 09:30:16 -0500 Subject: [PATCH 17/28] Fix irregular usage of bash it vs. bash-it --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5af3056e..e5c7aae2 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,13 @@ and anything in the custom directory will be ignored with the exception of `cust ## Themes -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). +There are a few bash it themes, but I'm hoping the community will jump in and create their own custom prompts and share their creations with everyone else by submitting a pull request to me (revans). ## Help out -I think all of us have our own custom scripts that we have added over time and so following in the footsteps of oh-my-zsh, bash-it was created as a framework for those who choose to use bash as their shell. As a community, I'm excited to see what everyone else has in their custom toolbox and am hoping that they'll share it with everyone by submitting a pull request to bash-it. +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! +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 From e1eb0114ed1d152d3c32dec8d8a8167817c93ed0 Mon Sep 17 00:00:00 2001 From: Adrian Rego Date: Mon, 27 Jun 2011 20:00:27 -0400 Subject: [PATCH 18/28] relieving headaches with a tylenol theme --- themes/tylenol/tylenol.theme.bash | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 themes/tylenol/tylenol.theme.bash diff --git a/themes/tylenol/tylenol.theme.bash b/themes/tylenol/tylenol.theme.bash new file mode 100644 index 00000000..c915f561 --- /dev/null +++ b/themes/tylenol/tylenol.theme.bash @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Based on 'bobby' theme with the addition of virtualenv_prompt +# + +SCM_THEME_PROMPT_DIRTY=" ${red}✗" +SCM_THEME_PROMPT_CLEAN=" ${green}✓" +SCM_THEME_PROMPT_PREFIX=" ${yellow}|${reset_color}" +SCM_THEME_PROMPT_SUFFIX="${yellow}|" + +RVM_THEME_PROMPT_PREFIX="|" +RVM_THEME_PROMPT_SUFFIX="|" +VIRTUALENV_THEME_PROMPT_PREFIX='|' +VIRTUALENV_THEME_PROMPT_SUFFIX='|' + +function prompt_command() { + PS1="\n${green}$(virtualenv_prompt)${red}$(rvm_version_prompt) ${reset_color}\h ${orange}in ${reset_color}\w\n${yellow}$(scm_char)$(scm_prompt_info) ${yellow}→${white} " +} + +PROMPT_COMMAND=prompt_command; From d82d8fbbe8fe0ab67781136177684d34b79d71ca Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Tue, 28 Jun 2011 00:22:43 -0500 Subject: [PATCH 19/28] Add install script --- install.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..3fc647b4 --- /dev/null +++ b/install.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +cp $HOME/.bash_profile $HOME/.bash_profile.bak + +echo "Your original .bash_profile has been backed up to .bash_profile.bak" + +cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/.bash_profile + +echo "Copied the template .bash_profile into ~/.bash_profile, edit this file to customize bash-it" + +while true +do + read -p "Do you use Jekyll? (If you don't know what Jekyll is, answer 'n') [Y/N] " RESP + + case $RESP + in + [yY]) + cp $HOME/.bash_it/template/jekyllconfig.template.bash $HOME/.jekyllconfig + echo "Copied the template .jekyllconfig into your home directory. Edit this file to customize bash-it for using the Jekyll plugins" + break + ;; + [nN]) + break + ;; + *) + echo "Please enter Y or N" + esac +done From b7c4b36ed247a90636200c4e9610e0a1032d85b9 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Tue, 28 Jun 2011 00:22:51 -0500 Subject: [PATCH 20/28] Add instructions for installing with the installation script --- README.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e5c7aae2..89f3d0d0 100644 --- a/README.md +++ b/README.md @@ -6,21 +6,17 @@ 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: 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 +Then run the `install.sh` file, it will backup your `~/.bash_profile` +file and move the template one into it's place (the template file is at +`~/.bash_it/template/bash_profile.template.bash`). It will also prompt +you asking if you use [Jekyll](https://github.com/mojombo/jekyll). This +is to set up the `.jekyllconfig` file, the file that stores the +information needed to use the Jekyll plugin supplied with bash it. -To configure Jekyll support for bash it, move the -jekyllconfig.template.bash to your home directory: - - cp /template/jekyllconfig.template.bash ~/.jekyllconfig - -Be sure to edit this file to your needed specifications. Please note -that this file is *not* required. Only use it if you plan on using the -jekyll plugins. ## Help Screens From ed8332d8d4161ff7ffeaa21f2bfe678466f0caa3 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Tue, 28 Jun 2011 00:25:26 -0500 Subject: [PATCH 21/28] Add clarification to README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89f3d0d0..933b333c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,10 @@ Check a clone of this repo: Then run the `install.sh` file, it will backup your `~/.bash_profile` file and move the template one into it's place (the template file is at -`~/.bash_it/template/bash_profile.template.bash`). It will also prompt +`~/.bash_it/template/bash_profile.template.bash`). Be sure to edit this +template file in order to customize bash-it. + +The install script will also prompt you asking if you use [Jekyll](https://github.com/mojombo/jekyll). This is to set up the `.jekyllconfig` file, the file that stores the information needed to use the Jekyll plugin supplied with bash it. From f6950f9f7bcff2b58aff995b4fddde438d1c1a1b Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Wed, 29 Jun 2011 11:33:39 -0500 Subject: [PATCH 22/28] Add gem completion --- completion/available/gem.completion.bash | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 completion/available/gem.completion.bash diff --git a/completion/available/gem.completion.bash b/completion/available/gem.completion.bash new file mode 100644 index 00000000..7231eef0 --- /dev/null +++ b/completion/available/gem.completion.bash @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# Completion for gem + +if [ -z "$REMOTE_GEMS" ] +then + REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') ) +fi + +if [ -z "$LOCAL_GEMS" ] +then + LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') ) +fi + +_installcomp() { + local cur=${COMP_WORDS[COMP_CWORD]} + COMPREPLY=( $(compgen -W "${REMOTE_GEMS[*]}" -- $cur) ) +} + +_uninstallcomp() { + local cur=${COMP_WORDS[COMP_CWORD]} + COMPREPLY=( $(compgen -W "${LOCAL_GEMS[*]}" -- $cur) ) +} + +_gem() { + local cur=${COMP_WORDS[COMP_CWORD]} + local prev=${COMP_WORDS[COMP_CWORD-1]} + case $prev in + install) + _installcomp + return 0 + ;; + uninstall) + _uninstallcomp + return 0 + ;; + esac + local commands=(build cert check cleanup contents dependency environment fetch generate_index help install list lock outdated owner pristine push query rdoc search server sources specification stale uninstall unpack update which) + COMPREPLY=( $(compgen -W "${commands[*]}" -- $cur) ) +} + +complete -F _gem gem From 1a969458858a5ad892ab9a6b36592cf50348d162 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Thu, 30 Jun 2011 08:30:46 -0500 Subject: [PATCH 23/28] Fix grammar on error message --- plugins/available/osx.plugin.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/available/osx.plugin.bash b/plugins/available/osx.plugin.bash index e6271bd7..76e4b9a5 100644 --- a/plugins/available/osx.plugin.bash +++ b/plugins/available/osx.plugin.bash @@ -17,7 +17,7 @@ EOF function dock-switch() { if [ $(uname) = "Darwin" ]; then - + if [ $1 = 3d ] ; then defaults write com.apple.dock no-glass -boolean NO killall Dock @@ -28,10 +28,10 @@ function dock-switch() { else echo "usage:" - echo "dock-switch 2d" + echo "dock-switch 2d" echo "dock-switch 3d." fi else - echo "sorry. you're currently not using os x" + echo "Sorry, this only works on Mac OS X" fi } From c5b5a1982f335e34bc20f644f496aa1664a0bf98 Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 30 Jun 2011 08:15:26 -0700 Subject: [PATCH 24/28] Edited README.md for punctuation, phrasing, tone, and clarity. --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 933b333c..f5b9201b 100644 --- a/README.md +++ b/README.md @@ -1,53 +1,53 @@ # 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](https://github.com/robbyrussell/oh-my-zsh). :) +**Bash it** is a mash up of my own bash commands and scripts, other bash stuff I have found. -Includes some autocompletion tools, theming support, aliases, custom functions, a few stolen pieces from Steve Losh, and more. +(And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh). :) + +Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more. ## Install -Check a clone of this repo: +1. Check a clone of this repo: `git clone http://github.com/revans/bash-it.git bash_it` +2. Run `install.sh` (it automatically backs up your `~/.bash_profile`) +3. Move `~/.bash_it/template/bash_profile.template.bash` into its place. (Edit this template file in order to customize bash-it.) - git clone http://github.com/revans/bash-it.git bash_it - -Then run the `install.sh` file, it will backup your `~/.bash_profile` -file and move the template one into it's place (the template file is at -`~/.bash_it/template/bash_profile.template.bash`). Be sure to edit this -template file in order to customize bash-it. - -The install script will also prompt -you asking if you use [Jekyll](https://github.com/mojombo/jekyll). This -is to set up the `.jekyllconfig` file, the file that stores the -information needed to use the Jekyll plugin supplied with bash it. +**NOTE:** +The install script will also prompt you asking if you use [Jekyll](https://github.com/mojombo/jekyll). +This is to set up the `.jekyllconfig` file, which stores info necessary to use the Jekyll plugin. ## Help Screens - bash-it (will show all the help commands) - aliases-help - rails-help - git-help - plugins-help +``` +bash-it (will show all the help commands) +aliases-help +rails-help +git-help +plugins-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: +For custom scripts, and aliases, just create the following files (they'll 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`. +Anything in the custom directory will be ignored, with the exception of `custom/example.bash`. ## Themes -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). +There are a few bash it themes. If you've created your own custom prompts, I'd love it if you shared with everyone else! Just submit a Pull Request to me (revans). ## Help out -I think all of us have our own custom scripts that we have added over time and so following in the footsteps of oh-my-zsh, bash it was created as a framework for those who choose to use bash as their shell. As a community, I'm excited to see what everyone else has in their custom toolbox and am hoping that they'll share it with everyone by submitting a pull request to bash it. +I think everyone has their own custom scripts accumulated over time. And so, following in the footsteps of oh-my-zsh, bash it is a framework for easily customizing your bash shell. Everyone's got a custom toolbox, so let's start making them even better, **as a community!** -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! +Send me a pull request and I'll merge it as long as it looks good. If you change an existing command, please give an explanation why. That will help a lot when I merge your changes in. + +Thanks, and happing bashing! ## Contributors From a85080c8b0c2acff0190b856b62eff1db0521d58 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Thu, 30 Jun 2011 11:28:32 -0500 Subject: [PATCH 25/28] Fix extra step in install section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5b9201b..3a529e3a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Includes autocompletion, themes, aliases, custom functions, a few stolen pieces 1. Check a clone of this repo: `git clone http://github.com/revans/bash-it.git bash_it` 2. Run `install.sh` (it automatically backs up your `~/.bash_profile`) -3. Move `~/.bash_it/template/bash_profile.template.bash` into its place. (Edit this template file in order to customize bash-it.) +3. Edit your `~/.bash_profile` file in order to customize bash-it. **NOTE:** The install script will also prompt you asking if you use [Jekyll](https://github.com/mojombo/jekyll). From 450a1d1090a5fdc7afc66ad752f87471d2a004d6 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 2 Jul 2011 21:44:47 -0500 Subject: [PATCH 26/28] Added JEKYLL_EDITOR variable This will replace the default $EDITOR used in the Jekyll plugin --- template/jekyllconfig.template.bash | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/jekyllconfig.template.bash b/template/jekyllconfig.template.bash index e4705181..291bf85e 100644 --- a/template/jekyllconfig.template.bash +++ b/template/jekyllconfig.template.bash @@ -15,3 +15,7 @@ REMOTES="user@host_1:path user@host_2:path" # Same rules as above. Can be HTML, textile, or markdown MARKUPS="markdown textile" + +# If you want to use a different editor for Jekyll, change the value of this variable + +JEKYLL_EDITOR="$EDITOR" From e1a299eafba5b6777c2f8234062fc67c8c8790f4 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 2 Jul 2011 21:44:56 -0500 Subject: [PATCH 27/28] Implement JEKYLL_EDITOR variable --- plugins/available/jekyll.plugins.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/available/jekyll.plugins.bash b/plugins/available/jekyll.plugins.bash index 8efdd11f..eff85ce3 100644 --- a/plugins/available/jekyll.plugins.bash +++ b/plugins/available/jekyll.plugins.bash @@ -41,11 +41,11 @@ editpost() { done less $TMPFILE read -p "Number of post to edit: " POST_TO_EDIT - if [ -z "$EDITOR" ] + if [ -z "$JEKYLL_EDITOR" ] then nano "${POSTS[$POST_TO_EDIT]}" else - "$EDITOR" "${POSTS[$POST_TO_EDIT]}" + "$JEKYLL_EDITOR" "${POSTS[$POST_TO_EDIT]}" fi } @@ -253,7 +253,7 @@ newpost() { # Open the file in your favorite editor - "$EDITOR" $FNAME + "$JEKYLL_EDITOR" $FNAME } function testsite() { From 3a2b525ac65fd06470cb3fed6efdac70b03d4e35 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Thu, 7 Jul 2011 11:04:27 -0500 Subject: [PATCH 28/28] Added prevcurl function Downloads a file and opens it in Preivew.app --- plugins/available/osx.plugin.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/available/osx.plugin.bash b/plugins/available/osx.plugin.bash index 76e4b9a5..cf553777 100644 --- a/plugins/available/osx.plugin.bash +++ b/plugins/available/osx.plugin.bash @@ -35,3 +35,14 @@ function dock-switch() { echo "Sorry, this only works on Mac OS X" fi } + +# Download a file and open it in Preview + +function prevcurl() { + if [ ! $(uname) = "Darwin" ] + then + echo "This function only works with Mac OS X" + return 1 + fi + curl "$*" | open -fa "Preview" +}