├── .rspec ├── .inputrc ├── sublime_key_bindings ├── .gitignore_global ├── README.md ├── .irbrc ├── sublimelink ├── .config └── fish │ ├── functions │ ├── rvm.fish │ └── fish_prompt.fish │ └── config.fish ├── install ├── .gitconfig ├── Prefrences.sublime-settings-user └── .bash_profile /.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | -------------------------------------------------------------------------------- /.inputrc: -------------------------------------------------------------------------------- 1 | set bell-style visible 2 | set completion-ignore-case on 3 | set show-all-if-ambiguous on 4 | -------------------------------------------------------------------------------- /sublime_key_bindings: -------------------------------------------------------------------------------- 1 | [ 2 | // Rails ERB tags 3 | { "keys": ["ctrl+shift+."], "command": "erb" }, 4 | // Change syntax to Ruby 5 | {"keys": ["super+shift+r"], "command": "set_file_type", 6 | "args": {"syntax": "Packages/Ruby/Ruby.tmLanguage"} 7 | } 8 | ] 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore_global: -------------------------------------------------------------------------------- 1 | # Any files matching the search terms in this file will be ignored by git 2 | 3 | # .DS_Store holds information about the current folder for OSX 4 | # such as icon placement 5 | .DS_Store 6 | 7 | # Backup files created by the vim text editor 8 | .swp 9 | 10 | # *.sqlite3 are local databases. Make your own, don't share 11 | *.sqlite3 12 | 13 | # .Spotlight-V100 holds spotlight index files 14 | .Spotlight-V100 15 | 16 | # .Trashes holds disk specific trash folders 17 | .Trashes -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | dotfiles 2 | ======== 3 | 4 | These are a collection of dotfiles. 5 | 6 | + Either copy paste install these or run ./install to copy over your local settings 7 | + Sublime symlinking for both Sublime text 2 and 3 can be run with ./sublimelink 8 | + A Standard install will overwrite your .gitconfig removing your github username and email. To set them again type 9 | ``` bash 10 | git config --global user.name "John Doe" 11 | git config --global user.email johndoe@example.com 12 | ``` 13 | -------------------------------------------------------------------------------- /.irbrc: -------------------------------------------------------------------------------- 1 | # Auto-complete for method names and such 2 | require 'irb/completion' 3 | 4 | # Awesomeprint replaces irb's default pretty printing with fancier formatting 5 | require "awesome_print" 6 | AwesomePrint.irb! 7 | 8 | # Loads simple IRB (without RVM notice) 9 | IRB.conf[:PROMPT_MODE] = :SIMPLE 10 | 11 | 12 | IRB.conf[:AUTO_INDENT] = true 13 | 14 | # A method for clearing the screen 15 | def clear 16 | system('clear') 17 | end 18 | 19 | puts ("Loading ~/.irbrc a file that loads everytime you load irb") 20 | -------------------------------------------------------------------------------- /sublimelink: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | test -d /Applications/Sublime\ Text\ 2.app/ && { 4 | test /usr/local/bin/subl && rm /usr/local/bin/subl 5 | mkdir -p /usr/local/bin/ 6 | ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl 7 | exit 0 8 | } 9 | 10 | test -d /Applications/Sublime\ Text.app/ && { 11 | test /usr/local/bin/subl && rm /usr/local/bin/subl 12 | mkdir -p /usr/local/bin/ 13 | ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl 14 | exit 0 15 | } 16 | 17 | exit 1 -------------------------------------------------------------------------------- /.config/fish/functions/rvm.fish: -------------------------------------------------------------------------------- 1 | function rvm -d 'Ruby enVironment Manager' 2 | set -l rvm_script '' 3 | 4 | if test -e /usr/local/rvm/scripts/rvm 5 | set rvm_script /usr/local/rvm/scripts/rvm 6 | end 7 | 8 | if test -e $HOME/.rvm/scripts/rvm 9 | set rvm_script $HOME/.rvm/scripts/rvm 10 | end 11 | 12 | set -l env_file (mktemp -t rvm.fish.XXXXXXXXXX) 13 | bash -c 'source '$rvm_script'; rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv 14 | and eval (grep '^rvm\|^[^=]*PATH' $env_file | grep -v _clr | sed '/^[^=]*PATH/y/:/ /; s/^/set -xg /; s/=/ /; s/$/ ;/; s/(//; s/)//') 15 | 16 | rm -f $env_file 17 | end 18 | -------------------------------------------------------------------------------- /.config/fish/functions/fish_prompt.fish: -------------------------------------------------------------------------------- 1 | function fish_prompt 2 | set -l cyan (set_color -o cyan) 3 | set -l yellow (set_color -o yellow) 4 | set -l red (set_color -o red) 5 | set -l blue (set_color -o blue) 6 | set -l normal (set_color normal) 7 | 8 | set -l arrow "$red➜ " 9 | set -l cwd $cyan(basename (prompt_pwd)) 10 | 11 | if [ (_git_branch_name) ] 12 | set -l git_branch $red(_git_branch_name) 13 | set git_info "$blue git:($git_branch$blue)" 14 | 15 | if [ (_is_git_dirty) ] 16 | set -l dirty "$yellow ✗" 17 | set git_info "$git_info$dirty" 18 | end 19 | end 20 | 21 | echo -n -s $arrow $cwd $git_info $normal '>' 22 | end 23 | 24 | 25 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit on any failure 4 | 5 | cp .bash_profile $HOME/.bash_profile 6 | cp .gitconfig $HOME/.gitconfig 7 | cp .gitignore_global $HOME/.gitignore_global 8 | cp .irbrc $HOME/.irbrc 9 | cp .rspec $HOME/.rspec 10 | cp .inputrc $HOME/.inputrc 11 | 12 | test -d /Applications/Sublime\ Text\ 2.app/ && { 13 | cp Prefrences.sublime-settings-user $HOME/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/Preferences.sublime-settings 14 | cp sublime_key_bindings $HOME/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/Default\ \(OSX\).sublime-keymap 15 | } 16 | 17 | test -d /Applications/Sublime\ Text.app && { 18 | echo "Sublime Text 3 prefs auto install not currently supported." 19 | } 20 | 21 | curl --silent http://levien.com/type/myfonts/Inconsolata.otf -o $HOME/Library/Fonts/Inconsolata.otf 22 | 23 | ./sublimelink 24 | 25 | echo "Dotfiles in $USER's home directory have been replaced" 26 | echo "Reload shell for changes to take effect" 27 | echo "Please set your git user name and email again." -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [core] 2 | # Excludesfiles allows us to set a global list of things to ignore 3 | excludesfile = ~/.gitignore_global 4 | 5 | # These are custom color options for the console 6 | [color] 7 | status = auto 8 | diff = auto 9 | 10 | [color "status"] 11 | untracked = cyan 12 | changed = green 13 | added = yellow 14 | 15 | # Aliases are command shortcuts 16 | [alias] 17 | co = checkout 18 | 19 | # lg is now a shortcut for a pretty log with short commit messages 20 | # See the log manpage: https://www.kernel.org/pub/software/scm/git/docs/git-log.html 21 | # for explanations of what these options do 22 | lg = log \ 23 | --graph \ 24 | --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \ 25 | --abbrev-commit \ 26 | --date=relative 27 | 28 | # Shorthand for commit, also enforces diff display in editor before commit 29 | ci = commit --verbose 30 | 31 | # Shorthand for a less noisy status 32 | s = commit --dry-run --short 33 | 34 | # More sensible names for adding and removing files from the readme 35 | stage = add 36 | unstage = reset HEAD 37 | 38 | # Edit the last commit 39 | amend= commit --verbose --amend -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | # in .config/fish/config.fish: 2 | # Fish git prompt 3 | set __fish_git_prompt_showdirtystate 'yes' 4 | set __fish_git_prompt_showstashstate 'yes' 5 | set __fish_git_prompt_showupstream 'yes' 6 | set __fish_git_prompt_color_branch white 7 | 8 | # Status Chars 9 | set __fish_git_prompt_char_dirtystate '⚡' 10 | set __fish_git_prompt_char_stagedstate ' →' 11 | set __fish_git_prompt_char_stashstate ' ↩' 12 | set __fish_git_prompt_char_upstream_ahead ' ↑' 13 | set __fish_git_prompt_char_upstream_behind ' ↓' 14 | 15 | 16 | function fish_prompt 17 | set last_status $status 18 | 19 | set_color $fish_color_cwd 20 | printf '%s' (prompt_pwd) 21 | set_color normal 22 | 23 | printf '%s > ' (__fish_git_prompt) 24 | 25 | set_color normal 26 | end 27 | 28 | rvm > /dev/null 29 | 30 | set fish_greeting "Welcome Back Christopher! :)" 31 | 32 | if status --is-interactive 33 | set -g -x PATH /usr/local/bin $PATH 34 | set -g -x PATH /usr/local/sbin $PATH 35 | end 36 | 37 | function fish_right_prompt -d "Write out the right prompt" 38 | set -l red (set_color -o red) 39 | set -l ruby $red(~/.rvm/bin/rvm-prompt) 40 | echo $ruby 41 | end 42 | 43 | set -x PGDATA $HOME/.pgdata 44 | 45 | function pgstart 46 | pg_ctl -l $PGDATA/logfile start 47 | end 48 | 49 | function pgstop 50 | pg_ctl stop 51 | end 52 | -------------------------------------------------------------------------------- /Prefrences.sublime-settings-user: -------------------------------------------------------------------------------- 1 | { 2 | "auto_complete_delay": 25, 3 | "bold_folder_labels": true, 4 | "caret_style": "blink", 5 | "color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme", 6 | "file_exclude_patterns": 7 | [ 8 | ".DS_Store", 9 | ".tags*", 10 | "*.pyc", 11 | "*.pyo", 12 | "*.exe", 13 | "*.dll", 14 | "*.obj", 15 | "*.o", 16 | "*.a", 17 | "*.lib", 18 | "*.so", 19 | "*.dylib", 20 | "*.ncb", 21 | "*.sdf", 22 | "*.suo", 23 | "*.pdb", 24 | "*.idb", 25 | "*.class", 26 | "*.psd", 27 | "*.db", 28 | "*.pdf" 29 | ], 30 | "folder_exclude_patterns": 31 | [ 32 | "data", 33 | ".zeus.sock", 34 | ".git", 35 | ".svn", 36 | ".hg", 37 | "CVS", 38 | ".sass-cache", 39 | ".bundle", 40 | "bundle", 41 | ".rbx", 42 | "script", 43 | "tmp", 44 | "log" 45 | ], 46 | "font_face": "Inconsolata", 47 | "font_size": 21.0, 48 | "highlight_line": true, 49 | "highlight_modified_tabs": true, 50 | "ignored_packages": 51 | [ 52 | "Vintage" 53 | ], 54 | "indent_guide_options": 55 | [ 56 | "draw_active" 57 | ], 58 | "line_padding_bottom": 0.5, 59 | "line_padding_top": 0.5, 60 | "save_on_focus_lost": true, 61 | "scroll_past_end": true, 62 | "shift_tab_unindent": true, 63 | "tab_size": 2, 64 | "translate_tabs_to_spaces": true, 65 | "trim_trailing_white_space_on_save": true, 66 | "word_wrap": "true" 67 | } 68 | -------------------------------------------------------------------------------- /.bash_profile: -------------------------------------------------------------------------------- 1 | # echo is like puts for bash (bash is the program running in your terminal) 2 | echo "Loading ~/.bash_profile a shell script that runs in every new terminal you open" 3 | 4 | # $VARIABLE will render before the rest of the command is executed 5 | echo "Logged in as $USER at $(hostname)" 6 | 7 | # Load RVM into a shell session *as a function* 8 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 9 | # Path for RVM 10 | test -d "$HOME/.rvm/bin" && PATH="$PATH:$HOME/.rvm/bin" 11 | 12 | # Rbenv autocomplete and shims 13 | if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi 14 | # Path for RBENV 15 | test -d "$HOME/.rbenv/" && PATH="$HOME/.rbenv/bin:$PATH" 16 | 17 | # Path changes are made non-destructive with PATH=new_path;$PATH This is like A=A+B so we preserve the old path 18 | 19 | # Path order matters, putting /usr/local/bin before /usr/bin 20 | # ensures brew programs will be seen and used before another program 21 | # of the same name is called 22 | 23 | # Path for brew 24 | test -d /usr/local/bin && export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH" 25 | # Path for Heroku 26 | test -d /usr/local/heroku/ && export PATH="/usr/local/heroku/bin:$PATH" 27 | 28 | # Load git completions 29 | git_completion_script=/usr/local/etc/bash_completion.d/git-completion.bash 30 | test -s $git_completion_script && source $git_completion_script 31 | 32 | # A more colorful prompt 33 | # \[\e[0m\] resets the color to default color 34 | c_reset='\[\e[0m\]' 35 | # \e[0;31m\ sets the color to red 36 | c_path='\[\e[0;31m\]' 37 | # \e[0;32m\ sets the color to green 38 | c_git_clean='\[\e[0;32m\]' 39 | # \e[0;31m\ sets the color to red 40 | c_git_dirty='\[\e[0;31m\]' 41 | 42 | # PS1 is the variable for the prompt you see everytime you hit enter 43 | if [ $OSTYPE == 'darwin15' ] && ! [ $ITERM_SESSION_ID ] 44 | then 45 | PROMPT_COMMAND=$PROMPT_COMMAND'; PS1="${c_path}\W${c_reset}$(git_prompt) :> "' 46 | else 47 | PROMPT_COMMAND=$PROMPT_COMMAND' PS1="${c_path}\W${c_reset}$(git_prompt) :> "' 48 | fi 49 | 50 | # determines if the git branch you are on is clean or dirty 51 | git_prompt () 52 | { 53 | # Is this a git directory? 54 | if ! git rev-parse --git-dir > /dev/null 2>&1; then 55 | return 0 56 | fi 57 | # Grab working branch name 58 | git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p') 59 | # Clean or dirty branch 60 | if git diff --quiet 2>/dev/null >&2; then 61 | git_color="${c_git_clean}" 62 | else 63 | git_color=${c_git_dirty} 64 | fi 65 | echo " [$git_color$git_branch${c_reset}]" 66 | } 67 | 68 | # Colors ls should use for folders, files, symlinks etc, see `man ls` and 69 | # search for LSCOLORS 70 | export LSCOLORS=ExGxFxdxCxDxDxaccxaeex 71 | # Force ls to use colors (G) and use humanized file sizes (h) 72 | alias ls='ls -Gh' 73 | 74 | # Force grep to always use the color option and show line numbers 75 | export GREP_OPTIONS='--color=always' 76 | 77 | # Set sublime as the default editor 78 | which -s subl && export EDITOR="subl --wait" 79 | 80 | # Useful aliases 81 | 82 | alias e="subl" 83 | alias be="bundle exec" 84 | --------------------------------------------------------------------------------