Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dot files?

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

0 comments on commit 460cae9

Please sign in to comment.
Something went wrong with that request. Please try again.