From 758c57621a59f4e3b8344faaae39bf00bcee107a Mon Sep 17 00:00:00 2001 From: Ryan Kanno Date: Sat, 18 Jun 2011 10:07:26 -1000 Subject: [PATCH 1/6] Removed variables specific to hawaii50 theme :) --- themes/base.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 71b11aeb..feee64e8 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -93,7 +93,7 @@ function hg_prompt_info() { branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') - echo -e "$prefix${REF_COLOR}${branch}${DEFAULT_COLOR}:${changeset#*:}$state$suffix" + echo -e "$prefix$branch:${changeset#*:}$state$suffix" } function rvm_version_prompt { From 11b595516167927b70d182ab8d38257c9e86cfc3 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Mon, 20 Jun 2011 16:13:34 -0400 Subject: [PATCH 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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"