Browse files

bash rework

  • Loading branch information...
1 parent 6c2adf7 commit fb448c4dcc595d501297a8d70fafa53754922469 @erikankrom committed May 9, 2012
View
2 bash/aliases → bash/bash_aliases
@@ -1,3 +1,5 @@
+#!/bin/bash
+
alias reload=". ~/.bash_profile"
# Easier navigation: .., ..., ~ and -
View
11 bash/bash_complete
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# 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
+
+# Add tab completion for `defaults read|write NSGlobalDomain`
+# You could just use `-g` instead, but I like being explicit
+complete -W "NSGlobalDomain" defaults
+
+# Add `killall` tab completion for common apps
+complete -o "nospace" -W "Finder Dock Mail Safari iTunes iCal Address\ Book SystemUIServer" killall
View
6 bash/exports → bash/bash_exports
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# Make vim the default editor
export EDITOR="nano"
@@ -15,6 +17,4 @@ export HISTCONTROL=ignoredups
# Make some commands not show up in history
export HISTIGNORE="ls:ls *:cd:cd -:pwd;exit:date:* --help"
-# PIP & virtualenv
-export PIP_VIRTUALENV_BASE=$WORKON_HOME
-export PIP_RESPECT_VIRTUALENV=true
+
View
26 bash/bash_profile
@@ -1,4 +1,28 @@
+#!/bin/bash
+
# Enable bash completion
if [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
-fi
+fi
+
+# Load ~/.bash_prompt, ~/.bash_exports, ~/.bash_aliases, ~/.bash_functions, ~/.bash_virtualenv
+for file in ~/.{bash_prompt,bash_exports,bash_aliases,bash_functions,bash_virtualenv}; do
+ [ -r "$file" ] && source "$file"
+done
+unset file
+
+# Load ~/.bash_extra, can be used for settings you don’t want to commit
+source ~/.bash_extra
+
+# Case-insensitive globbing (used in pathname expansion)
+shopt -s nocaseglob
+
+# Append to the Bash history file, rather than overwriting it
+shopt -s histappend
+
+# Autocorrect typos in path names when using `cd`
+shopt -s cdspell
+
+# Prefer US English and use UTF-8
+export LC_ALL="en_US.UTF-8"
+export LANG="en_US"
View
11 bash/bash_virtualenv
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then
+ export WORKON_HOME=$HOME/.virtualenvs
+ export PROJECT_HOME=$HOME/Projects
+ export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
+ export VIRTUALENVWRAPPER_HOOK_DIR=$HOME/Projects/dotfiles/virtualenvwrapper/
+ export PIP_VIRTUALENV_BASE=$WORKON_HOME
+ export PIP_RESPECT_VIRTUALENV=true
+ source /usr/local/bin/virtualenvwrapper.sh
+fi
View
0 bash/completions
No changes.

0 comments on commit fb448c4

Please sign in to comment.