Permalink
Browse files

dot files?

  • Loading branch information...
1 parent c08d9fd commit 460cae93f18b3ce52a8b3020702f3df11f353370 @chrisdrackett committed Jan 17, 2012
View
@@ -0,0 +1,5 @@
+.DS_Store
+
+files/.ssh/*id*
+files/.ssh/authorized_keys
+files/.ssh/known_hosts
View
@@ -0,0 +1,49 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+
+# Emits Git metadata for use in a Zsh prompt.
+#
+# AUTHOR:
+# Ben Hoskings
+# https://github.com/benhoskings/dot-files/blob/master/files/bin/git_cwd_info
+#
+# MODIFIED:
+# Geoffrey Grosenbach http://peepcode.com
+
+# The methods that get called more than once are memoized.
+
+def git_repo_path
+ @git_repo_path ||= `git rev-parse --git-dir 2>/dev/null`.strip
+end
+
+def in_git_repo
+ !git_repo_path.empty? &&
+ git_repo_path != '~' &&
+ git_repo_path != "#{ENV['HOME']}/.git"
+end
+
+def git_parse_branch
+ @git_parse_branch ||= `git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'`.chomp
+end
+
+def git_head_commit_id
+ `git rev-parse --short HEAD 2>/dev/null`.strip
+end
+
+def git_cwd_dirty
+ " %{\e[90m%}✗%{\e[0m%}" unless git_repo_path == '.' || `git ls-files -m`.strip.empty?
+end
+
+def rebasing_etc
+ if File.exists?(File.join(git_repo_path, 'BISECT_LOG'))
+ "+bisect"
+ elsif File.exists?(File.join(git_repo_path, 'MERGE_HEAD'))
+ "+merge"
+ elsif %w[rebase rebase-apply rebase-merge ../.dotest].any? {|d| File.exists?(File.join(git_repo_path, d)) }
+ "+rebase"
+ end
+end
+
+if in_git_repo
+ print " %{\e[90m%}#{git_parse_branch} %{\e[37m%}#{git_head_commit_id}%{\e[0m%}#{rebasing_etc}#{git_cwd_dirty}"
+end
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run when the list of virtualenvs is printed so each name can include details.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run during the startup phase when loading virtualenvwrapper.sh.
+
@@ -0,0 +1,21 @@
+#!/bin/bash
+# This hook is run after every virtualenv is activated.
+
+# This overrides the default behavior of placing the virtualenv's name
+# before our prompt.
+PS1="$_OLD_VIRTUAL_PS1"
+
+proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
+
+# After a virtualenv is activated, `cd` will jump to the root of the project.
+# rather than ~. Explicit paths will work as intended.
+# <http://www.doughellmann.com/docs/virtualenvwrapper/tips.html#changing-the-default-behavior-of-cd>
+cd () {
+ if (( $# == 0 ))
+ then
+ builtin cd $WORKON_HOME/$proj_name/src/$proj_name
+ else
+ builtin cd "$@"
+ fi
+}
+cd
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run after every virtualenv is deactivated.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run after a new project is activated.
+
@@ -0,0 +1,5 @@
+#!/bin/bash
+# This hook is run after a new virtualenv is activated.
+
+proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
+mkdir $WORKON_HOME/$proj_name/src
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run after a project is deleted.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run after a virtualenv is deleted.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run before every virtualenv is activated.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run before every virtualenv is deactivated.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run after a new project is created and before it is activated.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run after a new virtualenv is created and before it is activated.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run before a project is deleted.
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+# This hook is run before a virtualenv is deleted.
+
View
@@ -0,0 +1,16 @@
+alias git="hub"
+alias nano="mate"
+
+alias ..="cd .." # Go up one directory
+alias ...="cd ../.." # Go up two directories
+alias ls="ls -a" # Show hidden
+alias la="ls -AF" # Compact view, show hidden
+alias ll="ls -lFh" # Show hidden, long view
+alias rm="rm -i" # Are you sure?
+alias mv="mv -i" # Are you sure?
+alias free="free -m" # Show memory usage in megabytes
+alias rmpyc="find . -name '*.pyc' -delete" # Remove .PYC files.
+alias ping="ping -c 5" # Pings with 5 packets, not unlimited
+alias df="df -h" # Disk free, in gigabytes, not bytes
+alias du="du -h -c" # Calculate total disk usage for a folder
+alias home="cd $HOME_DIR"
View
@@ -0,0 +1,19 @@
+# General OS environment settings.
+export EDITOR="mate"
+export PATH=$HOME/Dropbox/Settings/dotfiles/bin:/usr/local/bin:/usr/local/sbin:/usr/local/Cellar/python/2.7.1/bin:/usr/local/pgsql/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin:$PATH
+export MANPATH="/usr/local/share/man:/usr/X11/man:/usr/share/man"
+
+export NODE_PATH="/usr/local/lib/node"
+
+export ARCHFLAGS="-arch i386 -arch x86_64"
+
+# Python.
+
+export PIP_RESPECT_VIRTUALENV="true"
+export PIP_VIRTUALENV_BASE=$WORKON_HOME
+export VIRTUALENVWRAPPER_VIRTUALENV_ARGS="--no-site-packages"
+export VIRTUALENVWRAPPER_HOOK_DIR="$HOME/Dropbox/Settings/dotfiles/virtualenvwrapper"
+export VIRTUALENV_WRAPPER_LOG_DIR="$HOME/.virtualenvlogs"
+export WORKON_HOME=~/src
+
+source /usr/local/Cellar/python/2.7.1/bin/virtualenvwrapper.sh
View
@@ -0,0 +1,13 @@
+# This zsh prompt is an amalgamation of many different prompts, but isn't
+# that the point?
+#
+
+function current_venv {
+ [ $VIRTUAL_ENV ] && echo ' '`basename $VIRTUAL_ENV`
+}
+
+local emoticon="%(?,%{$fg[green]%}%{$reset_color%},%{$fg[red]%}❨╯°□°❩╯︵ ┻━┻ %{$reset_color%}:: )"
+
+PROMPT='%{$fg_bold[yellow]%}%c %{$fg_bold[blue]%}>%{$reset_color%} '
+PROMPT2='\'
+RPROMPT='${emoticon}%{$fg_bold[yellow]%}%~%{$reset_color%}%{$fg_bold[green]%}$(current_venv)$(git-cwd-info.rb)'
View
@@ -0,0 +1,57 @@
+# Path to your oh-my-zsh configuration.
+ZSH=$HOME/.oh-my-zsh
+
+# Colors.
+autoload -U colors
+colors
+setopt prompt_subst
+
+# Ignore duplicates in history.
+setopt hist_ignore_dups
+
+. $ZSH/oh-my-zsh.sh
+. ~/Dropbox/Settings/dotfiles/zsh/prompt
+. ~/Dropbox/Settings/dotfiles/zsh/aliases
+. ~/Dropbox/Settings/dotfiles/zsh/env
+
+# General history related stuff.
+HISTFILE=~/.zsh_history
+HISTIGNORE="ls:ls *:cd:cd -:pwd;exit:date:* --help"
+HISTSIZE=1000000
+SAVEHIST=1000000
+setopt extendedglob notify
+setopt append_history
+setopt inc_append_history
+bindkey -e
+
+# Mappings for Ctrl/Option-left-arrow and Ctrl/Option-right-arrow for
+# moving across words.
+bindkey "\e\e[C" forward-word
+bindkey "\e\e[D" backward-word
+
+# Show completion on the first TAB.
+setopt menucomplete
+
+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/.
+plugins=(
+ brew
+ cloudapp
+ django
+ git
+ git-flow
+ github
+ heroku
+ mercurial
+ osx
+ pip
+ python
+ redis-cli
+ terminalapp
+ heroku
+ textmate
+)
+
+if [[ -f `brew --prefix`/share/python/virtualenvwrapper.sh ]]; then
+ . `brew --prefix`/share/python/virtualenvwrapper.sh
+fi

0 comments on commit 460cae9

Please sign in to comment.