Permalink
Browse files

Syncing up with what I like from holman/dotfiles

  • Loading branch information...
1 parent 2dac7c5 commit 3cbb6d6ffb4f7d7a1a032fb94b935d50ee7dec15 @dflems committed Jun 18, 2013
@@ -1,6 +1,6 @@
#!/bin/sh
# credit: http://nparikh.org/notes/zshrc.txt
-# Usage: smartextract <file>
+# Usage: extract <file>
# Description: extracts archived files / mounts disk images
# Note: .dmg/hdiutil is Mac OS X-specific.
@@ -19,7 +19,7 @@ if [ -f $1 ]; then
*.pax) cat $1 | pax -r ;;
*.pax.Z) uncompress $1 --stdout | pax -r ;;
*.Z) uncompress $1 ;;
- *) echo "'$1' cannot be extracted/mounted via smartextract" ;;
+ *) echo "'$1' cannot be extracted/mounted via extract" ;;
esac
else
echo "'$1' is not a valid file"
View
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# Sets up your branch to track a remote branch. Assumes you mean
+# `origin/$branch-name`.
+
+branch=$(git rev-parse --abbrev-ref HEAD)
+git branch $branch --set-upstream-to origin/$branch
View
@@ -0,0 +1,41 @@
+# Sets reasonable OS X defaults.
+#
+# Or, in other words, set shit how I like in OS X.
+#
+# The original idea (and a couple settings) were grabbed from:
+# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
+#
+# Run ./set-defaults.sh and you'll be good to go.
+
+# Disable press-and-hold for keys in favor of key repeat.
+defaults write -g ApplePressAndHoldEnabled -bool false
+
+# Use AirDrop over every interface. srsly this should be a default.
+defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1
+
+# Always open everything in Finder's list view. This is important.
+defaults write com.apple.Finder FXPreferredViewStyle Nlsv
+
+# Show the ~/Library folder.
+chflags nohidden ~/Library
+
+# Set a really fast key repeat.
+defaults write NSGlobalDomain KeyRepeat -int 0
+
+# Set the Finder prefs for showing a few different volumes on the Desktop.
+defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
+defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
+
+# Run the screensaver if we're in the bottom-left hot corner.
+defaults write com.apple.dock wvous-bl-corner -int 5
+defaults write com.apple.dock wvous-bl-modifier -int 0
+
+# Hide Safari's bookmark bar.
+defaults write com.apple.Safari ShowFavoritesBar -bool false
+
+# Set up Safari for development.
+defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
+defaults write com.apple.Safari IncludeDevelopMenu -bool true
+defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
+defaults write com.apple.Safari "com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled" -bool true
+defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
View
@@ -1 +1,5 @@
-export EDITOR='subl'
+# Only set this if we haven't set $EDITOR up somewhere else previously.
+if [[ "$EDITOR" == "" ]] ; then
+ # Use sublime for my editor.
+ export EDITOR='subl'
+fi
View
@@ -1,5 +1,5 @@
# GRC colorizes nifty unix tools all over the place
-if $(grc &>/dev/null)
+if $(grc &>/dev/null) && ! $(brew &>/dev/null)
then
source `brew --prefix`/etc/grc.bashrc
-fi
+fi
View
@@ -18,4 +18,4 @@ export PATH="$ZSH/bin:$ZSH/git/bin:$PATH"
export PATH="./bin:$PATH"
# manpages
-export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
+export MANPATH="/usr/local/man:/usr/local/mysql/man:/usr/local/git/man:$MANPATH"
View
@@ -50,7 +50,7 @@ case "$words[1]" in
list)
_arguments \
'(--unbrewed)--unbrewed[files in brew --prefix not controlled by brew]' \
- '1: :->forms' && return 0
+ '1: :->forms' && return 0
if [[ "$state" == forms ]]; then
_brew_installed_formulae
View
@@ -1,2 +1,2 @@
#compdef c
-_files -W $PROJECTS -/
+_files -W $PROJECTS -/
View
@@ -0,0 +1,26 @@
+# credit: http://nparikh.org/notes/zshrc.txt
+# Usage: extract <file>
+# Description: extracts archived files / mounts disk images
+# Note: .dmg/hdiutil is Mac OS X-specific.
+extract () {
+ if [ -f $1 ]; then
+ case $1 in
+ *.tar.bz2) tar -jxvf $1 ;;
+ *.tar.gz) tar -zxvf $1 ;;
+ *.bz2) bunzip2 $1 ;;
+ *.dmg) hdiutil mount $1 ;;
+ *.gz) gunzip $1 ;;
+ *.tar) tar -xvf $1 ;;
+ *.tbz2) tar -jxvf $1 ;;
+ *.tgz) tar -zxvf $1 ;;
+ *.zip) unzip $1 ;;
+ *.ZIP) unzip $1 ;;
+ *.pax) cat $1 | pax -r ;;
+ *.pax.Z) uncompress $1 --stdout | pax -r ;;
+ *.Z) uncompress $1 ;;
+ *) echo "'$1' cannot be extracted/mounted via extract()" ;;
+ esac
+ else
+ echo "'$1' is not a valid file"
+ fi
+}
@@ -1,5 +0,0 @@
-zstyle ':completion:*' verbose yes
-zstyle ':completion:*:descriptions' format '%B%d%b'
-zstyle ':completion:*:messages' format '%d'
-zstyle ':completion:*:warnings' format 'No matches for: %d'
-zstyle ':completion:*' group-name ''

0 comments on commit 3cbb6d6

Please sign in to comment.