From e5a21d53aca32937776c5c4852218d874927b303 Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Mon, 15 Oct 2012 15:14:21 +0400 Subject: [PATCH] Reorganize bash config. --- bash_profile | 21 +++++++++++--------- bash_aliases => includes/bash_aliases.sh | 0 includes/{functions.sh => bash_functions.sh} | 0 bash_prompt => includes/bash_prompt.sh | 0 setup/osx.sh | 1 + 5 files changed, 13 insertions(+), 9 deletions(-) rename bash_aliases => includes/bash_aliases.sh (100%) rename includes/{functions.sh => bash_functions.sh} (100%) rename bash_prompt => includes/bash_prompt.sh (100%) diff --git a/bash_profile b/bash_profile index b537d5a..20b6f5b 100644 --- a/bash_profile +++ b/bash_profile @@ -30,14 +30,17 @@ done export LC_ALL=en_US.UTF-8 export LANG="en_US" -# Add ~/bin to the $PATH -export PATH="$HOME/bin:/usr/local/bin:$PATH" -# Add brew coreutils to $PATH -command -v brew >/dev/null 2>&1 && export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH" +# Extend $PATH +[ -d ~/bin ] && PATH="~/bin:$PATH" +PATH="/usr/local/bin:$PATH" +command -v brew >/dev/null 2>&1 && PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH" +export PATH -# Load ~/.extra, ~/.bash_prompt and ~/.bash_aliases -# ~/.extra can be used for settings you don’t want to commit -for file in ~/.{extra,bash_prompt,bash_aliases}; do +# Load extra (private) settings +[ -r "~/.extra" ] && source "~/.extra" + +# Load prompt and aliases +for file in ~/dotfiles/includes/{bash_prompt,bash_aliases,bash_functions}; do [ -r "$file" ] && source "$file" done unset file @@ -49,10 +52,10 @@ unset file command -v brew >/dev/null 2>&1 && [ -r "$(brew --prefix)/etc/bash_completion" ] && source "$(brew --prefix)/etc/bash_completion" # Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards -[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh +[ -e "~/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh # Nano is default editor -export EDITOR='nano'; +export EDITOR='nano' # Tell ls to be colourful export CLICOLOR=1 diff --git a/bash_aliases b/includes/bash_aliases.sh similarity index 100% rename from bash_aliases rename to includes/bash_aliases.sh diff --git a/includes/functions.sh b/includes/bash_functions.sh similarity index 100% rename from includes/functions.sh rename to includes/bash_functions.sh diff --git a/bash_prompt b/includes/bash_prompt.sh similarity index 100% rename from bash_prompt rename to includes/bash_prompt.sh diff --git a/setup/osx.sh b/setup/osx.sh index ff7c25c..5fa3ee3 100755 --- a/setup/osx.sh +++ b/setup/osx.sh @@ -486,6 +486,7 @@ defaults write com.google.Chrome.canary ExtensionInstallSources -array "https:// ############################################################################### # Link Sublime Text 2 command line +[ ! -d ~/bin ] && mkdir ~/bin ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl ###############################################################################