Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mathiasbynens/dotfiles
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: forsen/dotfiles-archived
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing with 446 additions and 15 deletions.
  1. +14 −3 .aliases
  2. +21 −5 .bash_profile
  3. +8 −1 .bash_prompt
  4. +15 −2 .exports
  5. +16 −0 .functions
  6. +4 −0 .gitconfig
  7. +3 −0 .gitignore
  8. +353 −0 .vim/autoload/pathogen.vim
  9. 0 .vim/bundle/.gitignore
  10. +9 −4 .vimrc
  11. +3 −0 bin/gc
17 changes: 14 additions & 3 deletions .aliases
Original file line number Diff line number Diff line change
@@ -7,13 +7,14 @@ alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"

# Shortcuts
alias d="cd ~/Documents/Dropbox"
alias ic="cd ~/Library/Mobile\ Documents/com~apple~CloudDocs/"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias p="cd ~/projects"
alias g="git"
alias h="history"
alias j="jobs"
alias j="jump"
alias m="mark"

# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
@@ -45,7 +46,7 @@ alias week='date +%V'
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'

# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
alias update='sudo softwareupdate -i -a; brew update; brew upgrade --all; brew cleanup; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update'
alias update='sudo softwareupdate -i -a; brew update; brew upgrade --all; brew cleanup; npm install npm -g; npm update -g'

# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
@@ -139,3 +140,13 @@ alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resource

# Reload the shell (i.e. invoke as a login shell)
alias reload="exec $SHELL -l"

# LaTeX: Put auxillary files in a tmp directory
alias pdflatex="mkdir -p tmp; pdflatex -output-directory tmp"

# Prettify json
alias prettyjson="python -m json.tool"

# 'cat' last file in Downloads directory
alias cn="cat ~/Downloads/$(ls -t ~/Downloads/ |head -1)"

26 changes: 21 additions & 5 deletions .bash_profile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Add `~/bin` to the `$PATH`
export PATH="$HOME/bin:$PATH";
export PATH="/usr/local/bin:$HOME/bin:$PATH"

# Load the shell dotfiles, and then some:
# * ~/.path can be used to extend `$PATH`.
@@ -26,10 +26,10 @@ for option in autocd globstar; do
done;

# Add tab completion for many Bash commands
if which brew > /dev/null && [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then
source "$(brew --prefix)/share/bash-completion/bash_completion";
if which brew &> /dev/null && [ -f "$(brew --prefix)/etc/bash_completion" ]; then
. "$(brew --prefix)/etc/bash_completion";
elif [ -f /etc/bash_completion ]; then
source /etc/bash_completion;
. /etc/bash_completion;
fi;

# Enable tab completion for `g` by marking it as an alias for `git`
@@ -45,4 +45,20 @@ fi;
complete -W "NSGlobalDomain" defaults;

# Add `killall` tab completion for common apps
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall;
complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall

# If possible, add tab completion for many more commands
[ -f /etc/bash_completion ] && source /etc/bash_completion

# Set correct $JAVA_HOME
[ -f /usr/libexec/java_home ] && export JAVA_HOME=$(/usr/libexec/java_home)

# Adding completions for marks
_completemarks() {
local curw=${COMP_WORDS[COMP_CWORD]}
local wordlist=$(gfind $MARKPATH -type l -printf "%f\n" )
COMPREPLY=($(compgen -W '${wordlist[@]}' -- "$curw"))
return 0
}

complete -F _completemarks j jump unmark
9 changes: 8 additions & 1 deletion .bash_prompt
Original file line number Diff line number Diff line change
@@ -103,12 +103,19 @@ else
hostStyle="${yellow}";
fi;

# Use ComputerName instead of hostname if on mac
if [[ $OSTYPE == "darwin"* ]]; then
hostType="$(scutil --get ComputerName)";
else
hostType="\h";
fi;

# Set the terminal title to the current working directory.
PS1="\[\033]0;\w\007\]";
PS1+="\[${bold}\]\n"; # newline
PS1+="\[${userStyle}\]\u"; # username
PS1+="\[${white}\] at ";
PS1+="\[${hostStyle}\]\h"; # host
PS1+="\[${hostStyle}\]${hostType}"; # host
PS1+="\[${white}\] in ";
PS1+="\[${green}\]\w"; # working directory
PS1+="\$(prompt_git \"${white} on ${violet}\")"; # Git repository details
17 changes: 15 additions & 2 deletions .exports
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Make vim the default editor.
export EDITOR='vim';
# Make sublime the default editor
export EDITOR="subl -w"

# Enable persistent REPL history for `node`.
NODE_REPL_HISTORY_FILE=~/.node_history;
# Allow 32³ entries; the default is 1000.
NODE_REPL_HISTORY_SIZE='32768';
# Usually in development
export NODE_ENV=development

# Increase Bash history size. Allow 32³ entries; the default is 500.
export HISTSIZE='32768';
@@ -22,5 +24,16 @@ export LESS_TERMCAP_md="${yellow}";
# Don’t clear the screen after quitting a manual page.
export MANPAGER='less -X';

# Link Homebrew casks in `/Applications` rather than `~/Applications`
export HOMEBREW_CASK_OPTS="--appdir=/Applications"

# Export markpoath
export MARKPATH=$HOME/.marks

# Always enable colored `grep` output.
export GREP_OPTIONS='--color=auto';

# Android exports
export ANDROID_HOME=~/ANDROID_HOME
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
16 changes: 16 additions & 0 deletions .functions
Original file line number Diff line number Diff line change
@@ -244,3 +244,19 @@ function o() {
function tre() {
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
}

function jump {
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
}

function mark {
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
}

function unmark {
rm -i "$MARKPATH/$1"
}

function marks {
\ls -l "$MARKPATH" | tail -n +2 | sed 's/ / /g' | cut -d' ' -f9- | awk -F ' -> ' '{printf "%-10s -> %s\n", $1, $2}'
}
4 changes: 4 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -72,6 +72,9 @@
fi \
}; f"
# Nice tree of commitlog
tree = log --graph --pretty=format:'%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[apply]
# Detect whitespace errors when applying a patch
@@ -170,3 +173,4 @@
[url "git://gist.github.com/"]
insteadOf = "gist:"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,3 +12,6 @@ Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
.Trashes

# Emacs tmp file
.*~
Loading