Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 154 lines (98 sloc) 8.886 kb
6047707 Ben Alman Work in progress
authored
1 # Dotfiles
2
1538022 Ben Alman Rewrite README.
authored
3 My OSX / Ubuntu dotfiles.
6047707 Ben Alman Work in progress
authored
4
1538022 Ben Alman Rewrite README.
authored
5 ## About this project
085b904 Ben Alman Updated readme.
authored
6
7 I've been using bash on-and-off for a long time (since Slackware Linux was distributed on 1.44MB floppy disks). In all that time, every time I've set up a new Linux or OS X machine, I've copied over my `.bashrc` file and my `~/bin` folder to each machine manually. And I've never done a very good job of actually maintaining these files. It's been a total mess.
9d43713 Readme tweaks.
Ben Alman authored
8
085b904 Ben Alman Updated readme.
authored
9 I finally decided that I wanted to be able to execute a single command to "bootstrap" a new system to pull down all of my dotfiles and configs, as well as install all the tools I commonly use. In addition, I wanted to be able to re-execute that command at any time to synchronize anything that might have changed. Finally, I wanted to make it easy to re-integrate changes back in, so that other machines could be updated.
e41e577 Ben Alman Updated readme, added lots of comments. Minor tweaks as well.
authored
10
56c9434 Ben Alman Cleaning up README.
authored
11 That command is [dotfiles][dotfiles], and this is my "dotfiles" Git repo.
e41e577 Ben Alman Updated readme, added lots of comments. Minor tweaks as well.
authored
12
56c9434 Ben Alman Cleaning up README.
authored
13 [dotfiles]: bin/dotfiles
e41e577 Ben Alman Updated readme, added lots of comments. Minor tweaks as well.
authored
14
1538022 Ben Alman Rewrite README.
authored
15 ## How the "dotfiles" command works
d71696c Ben Alman Adding example output to readme.
authored
16
1538022 Ben Alman Rewrite README.
authored
17 When [dotfiles][dotfiles] is run for the first time, it does a few things:
52f94f9 Ben Alman Updated readme.
authored
18
1538022 Ben Alman Rewrite README.
authored
19 1. In Ubuntu, Git is installed if necessary via APT (it's already there in OSX).
20 1. This repo is cloned into your user directory, under `~/.dotfiles`.
21 1. Files in `/copy` are copied into `~/`. ([read more](#the-copy-step))
22 1. Files in `/link` are symlinked into `~/`. ([read more](#the-link-step))
23 1. You are prompted to choose scripts in `/init` to be executed. The installer attempts to only select relevant scripts, based on the detected OS and the script filename.
24 1. Your chosen init scripts are executed (in alphanumeric order, hence the funky names). ([read more](#the-init-step))
085b904 Ben Alman Updated readme.
authored
25
1538022 Ben Alman Rewrite README.
authored
26 On subsequent runs, step 1 is skipped, step 2 just updates the already-existing repo, and step 5 remembers what you selected the last time. The other steps are the same.
085b904 Ben Alman Updated readme.
authored
27
1538022 Ben Alman Rewrite README.
authored
28 ### Other subdirectories
29
30 * The `/backups` directory gets created when necessary. Any files in `~/` that would have been overwritten by files in `/copy` or `/link` get backed up there.
31 * The `/bin` directory contains executable shell scripts (including the [dotfiles][dotfiles] script) and symlinks to executable shell scripts. This directory is added to the path.
32 * The `/caches` directory contains cached files, used by some scripts or functions.
33 * The `/conf` directory just exists. If a config file doesn't **need** to go in `~/`, reference it from the `/conf` directory.
34 * The `/source` directory contains files that are sourced whenever a new shell is opened (in alphanumeric order, hence the funky names).
35 * The `/test` directory contains unit tests for especially complicated bash functions.
36 * The `/vendor` directory contains third-party libraries.
37
38 ### The "copy" step
574fa22 Ben Alman Update README links.
authored
39 Any file in the `/copy` subdirectory will be copied into `~/`. Any file that _needs_ to be modified with personal information (like [copy/.gitconfig](copy/.gitconfig) which contains an email address and private key) should be _copied_ into `~/`. Because the file you'll be editing is no longer in `~/.dotfiles`, it's less likely to be accidentally committed into your public dotfiles repo.
1538022 Ben Alman Rewrite README.
authored
40
41 ### The "link" step
574fa22 Ben Alman Update README links.
authored
42 Any file in the `/link` subdirectory gets symlinked into `~/` with `ln -s`. Edit one or the other, and you change the file in both places. Don't link files containing sensitive data, or you might accidentally commit that data! If you're linking a directory that might contain sensitive data (like `~/.ssh`) add the sensitive files to your [.gitignore](.gitignore) file!
1538022 Ben Alman Rewrite README.
authored
43
44 ### The "init" step
45 Scripts in the `/init` subdirectory will be executed. A whole bunch of things will be installed, but _only_ if they aren't already.
46
47 #### OS X
48
574fa22 Ben Alman Update README links.
authored
49 * Minor XCode init via the [init/10_osx_xcode.sh](init/10_osx_xcode.sh) script
50 * Homebrew via the [init/20_osx_homebrew.sh](init/20_osx_homebrew.sh) script
51 * Homebrew recipes via the [init/30_osx_homebrew_recipes.sh](init/30_osx_homebrew_recipes.sh) script
52 * Homebrew casks via the [init/30_osx_homebrew_casks.sh](init/30_osx_homebrew_casks.sh) script
c6db0fc Ben Alman Update stale links in README.
authored
53 * [Fonts](/cowboy/dotfiles/tree/master/conf/osx/fonts) via the [init/50_osx_fonts.sh](init/50_osx_fonts.sh) script
1538022 Ben Alman Rewrite README.
authored
54
55 #### Ubuntu
c6db0fc Ben Alman Update stale links in README.
authored
56 * APT packages and git-extras via the [init/20_ubuntu_apt.sh](init/20_ubuntu_apt.sh) script
1538022 Ben Alman Rewrite README.
authored
57
58 #### Both
574fa22 Ben Alman Update README links.
authored
59 * Node.js, npm and nave via the [init/50_node.sh](init/50_node.sh) script
60 * Ruby, gems and rbenv via the [init/50_ruby.sh](init/50_ruby.sh) script
61 * Vim plugins via the [init/50_vim.sh](init/50_vim.sh) script
52f94f9 Ben Alman Updated readme.
authored
62
b62749f Ben Alman Add more README-ness.
authored
63 ## Hacking my dotfiles
64
65 Because the [dotfiles][dotfiles] script is completely self-contained, you should be able to delete everything else from your dotfiles repo fork, and it will still work. The only thing it really cares about are the `/copy`, `/link` and `/init` subdirectories, which will be ignored if they are empty or don't exist.
66
67 If you modify things and notice a bug or an improvement, [file an issue](https://github.com/cowboy/dotfiles/issues) or [a pull request](https://github.com/cowboy/dotfiles/pulls) and let me know.
68
69 Also, before installing, be sure to [read my gently-worded note](#heed-this-critically-important-warning-before-you-install).
70
2729490 Added a bunch more stuff.
Ben Alman authored
71 ## Installation
1538022 Ben Alman Rewrite README.
authored
72
03adeb4 Ben Alman Adding cowsay to ubuntu.
authored
73 ### OS X Notes
085b904 Ben Alman Updated readme.
authored
74
1538022 Ben Alman Rewrite README.
authored
75 You need to have [XCode](https://developer.apple.com/downloads/index.action?=xcode) or, at the very minimum, the [XCode Command Line Tools](https://developer.apple.com/downloads/index.action?=command%20line%20tools), which are available as a much smaller download.
76
77 The easiest way to install the XCode Command Line Tools in OSX 10.9+ is to open up a terminal, type `xcode-select --install` and [follow the prompts](http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/).
78
79 _Tested in OSX 10.10_
b3ca64e Ben Alman Adding ubuntu_new vm creation alias. Nodejs is now installed via Nvm. Up...
authored
80
03adeb4 Ben Alman Adding cowsay to ubuntu.
authored
81 ### Ubuntu Notes
82
1538022 Ben Alman Rewrite README.
authored
83 You might want to set up your ubuntu server [like I do it](https://github.com/cowboy/dotfiles/wiki/ubuntu-setup), but then again, you might not.
84
85 Either way, you should at least update/upgrade APT with `sudo apt-get -qq update && sudo apt-get -qq dist-upgrade` first.
03adeb4 Ben Alman Adding cowsay to ubuntu.
authored
86
1538022 Ben Alman Rewrite README.
authored
87 _Tested in Ubuntu 14.04 LTS_
88
89 ### Heed this critically important warning before you install
90
91 **If you're not me, please _do not_ install dotfiles directly from this repo!**
92
93 Why? Because I often completely break this repo while updating. Which means that if I do that and you run the `dotfiles` command, your home directory will burst into flames, and you'll have to go buy a new computer. No, not really, but it will be very messy.
94
95 ### Actual installation (for you)
96
97 1. [Read my gently-worded note](#heed-this-critically-important-warning-before-you-install)
98 1. Fork this repo
99 1. Open a terminal/shell and do this:
03adeb4 Ben Alman Adding cowsay to ubuntu.
authored
100
b3ca64e Ben Alman Adding ubuntu_new vm creation alias. Nodejs is now installed via Nvm. Up...
authored
101 ```sh
1538022 Ben Alman Rewrite README.
authored
102 export github_user=YOUR_GITHUB_USER_NAME
103
104 bash -c "$(curl -fsSL https://raw.github.com/$github_user/dotfiles/master/bin/dotfiles)" && source ~/.bashrc
b3ca64e Ben Alman Adding ubuntu_new vm creation alias. Nodejs is now installed via Nvm. Up...
authored
105 ```
106
1538022 Ben Alman Rewrite README.
authored
107 Since you'll be using the [dotfiles][dotfiles] command on subsequent runs, you'll only have to export the `github_user` variable for the initial install.
108
b62749f Ben Alman Add more README-ness.
authored
109 There's a lot of stuff that requires admin access via `sudo`, so be warned that you might need to enter your password here or there.
1538022 Ben Alman Rewrite README.
authored
110
111 ### Actual installation (for me)
b3ca64e Ben Alman Adding ubuntu_new vm creation alias. Nodejs is now installed via Nvm. Up...
authored
112
113 ```sh
1538022 Ben Alman Rewrite README.
authored
114 bash -c "$(curl -fsSL https://bit.ly/cowboy-dotfiles)" && source ~/.bashrc
b3ca64e Ben Alman Adding ubuntu_new vm creation alias. Nodejs is now installed via Nvm. Up...
authored
115 ```
2729490 Added a bunch more stuff.
Ben Alman authored
116
085b904 Ben Alman Updated readme.
authored
117 ## Aliases and Functions
574fa22 Ben Alman Update README links.
authored
118 To keep things easy, the `~/.bashrc` and `~/.bash_profile` files are extremely simple, and should never need to be modified. Instead, add your aliases, functions, settings, etc into one of the files in the `source` subdirectory, or add a new file. They're all automatically sourced when a new shell is opened. Take a look, I have [a lot of aliases and functions](source). I even have a [fancy prompt](source/50_prompt.sh) that shows the current directory, time and current git/svn repo status.
daefd37 Readme tweaks.
Ben Alman authored
119
085b904 Ben Alman Updated readme.
authored
120 ## Scripts
b62749f Ben Alman Add more README-ness.
authored
121 In addition to the aforementioned [dotfiles][dotfiles] script, there are a few other [bin scripts](bin). This includes [nave](https://github.com/isaacs/nave), which is a [git submodule](vendor).
085b904 Ben Alman Updated readme.
authored
122
4fa1684 Ben Alman Updating readme.
authored
123 * [dotfiles][dotfiles] - (re)initialize dotfiles. It might ask for your password (for `sudo`).
b62749f Ben Alman Add more README-ness.
authored
124 * [src](link/.bashrc#L8-18) - (re)source all files in `/source` directory
574fa22 Ben Alman Update README links.
authored
125 * Look through the [bin](bin) subdirectory for a few more.
e41e577 Ben Alman Updated readme, added lots of comments. Minor tweaks as well.
authored
126
9da56fc Ben Alman Added prompt screenshot. This closes #4.
authored
127 ## Prompt
56c9434 Ben Alman Cleaning up README.
authored
128 I think [my bash prompt](source/50_prompt.sh) is awesome. It shows git and svn repo status, a timestamp, error exit codes, and even changes color depending on how you've logged in.
9da56fc Ben Alman Added prompt screenshot. This closes #4.
authored
129
a5232c4 Ben Alman Needed more awesome. Plus a few readme tweaks.
authored
130 Git repos display as **[branch:flags]** where flags are:
9da56fc Ben Alman Added prompt screenshot. This closes #4.
authored
131
132 **?** untracked files
133 **!** changed (but unstaged) files
134 **+** staged files
135
a5232c4 Ben Alman Needed more awesome. Plus a few readme tweaks.
authored
136 SVN repos display as **[rev1:rev2]** where rev1 and rev2 are:
9da56fc Ben Alman Added prompt screenshot. This closes #4.
authored
137
138 **rev1** last changed revision
139 **rev2** revision
140
141 Check it out:
142
143 ![My awesome bash prompt](http://farm8.staticflickr.com/7142/6754488927_563dd73553_b.jpg)
144
e41e577 Ben Alman Updated readme, added lots of comments. Minor tweaks as well.
authored
145 ## Inspiration
2729490 Added a bunch more stuff.
Ben Alman authored
146 <https://github.com/gf3/dotfiles>
daefd37 Readme tweaks.
Ben Alman authored
147 <https://github.com/mathiasbynens/dotfiles>
148 (and 15+ years of accumulated crap)
2729490 Added a bunch more stuff.
Ben Alman authored
149
6047707 Ben Alman Work in progress
authored
150 ## License
1538022 Ben Alman Rewrite README.
authored
151 Copyright (c) 2014 "Cowboy" Ben Alman
6921f28 Ben Alman Fixed license.
authored
152 Licensed under the MIT license.
6047707 Ben Alman Work in progress
authored
153 <http://benalman.com/about/license/>
Something went wrong with that request. Please try again.