Mother Effing Dotfiles
So… dotfiles…
These have been on my TODO list for a while, searching Google I couldn't really find any decent screencasts or thorough documentation for a n00b like me. I'd seen this page over at GitHub https://dotfiles.github.com/ and started by looking over some examples:
gf3, mathiasbynens, necolas, paulirish, holman, skwp.
Which lead me to look at a few other links: technicalpickles/homesick, robbyrussell/oh-my-zsh, robbyrussell/oh-my-zsh/wiki/Themes, oh-my-git-aliases, Bash Tutorial.
Before getting stuck in I had a few concerns, luckily awesome people like Mathias Bynens and Paul Irish helped me out.
@simonowendesign: If I add dotfiles, then delete them, will my settings go back to what they were before adding?
@mathias: In general, yes. Exceptions: files like .osx, who change system settings when sourced.
@simonowendesign: Thanks, have you ever broke anything with .osx, if so, how did you revert / fix it?
@mathias: defaults delete
@simonowendesign: If I was to start up an osx dotfile now (having previously not used one, but manually changing settings), will this set all my settings to default, then add the ones in my dotfiles, or will it only activate / deactivate the ones listed in the dotfile? @paul_irish: Just the ones listed, you only execute it once, and it just changes the ones in there, the osx one is a bit diff than most of the dotfiles, cuz they execute, set configuration, all the time.
@simonowendesign: Was wondering if there's any particular dotfile you'd recommend starting with? @paul_irish: bash_prompt! always.
Where To Start?
First off I backed up all my existing dotfiles, these are located in your user folder e.g. /Users/simonowen
. You'll need to be able to view hidden files, I use TotalFinder which has a handy shortcut for this, but there are commands you can run in the terminal as well to see these (this is actually included in the dotfiles).
Knife, Fork, Spoon?
I chose to take a fork from Paul Irish's dotfiles, I've watched screencasts that he's done and knew there was lots of awesomeness going on that I wanted to get to grips with. After that I cloned the repo to my computer and started digging around. I changed references from Paul Irish to myself, then I read through all the files, yup, all of them and others too (I'd strongly recommend this, rather than rushing into it). Then I went over them again and commented out parts I was unsure about or I knew wouldn't apply to my setup and added some TODOs of things I wanted to update [! Note to self, add these as issues !].
Committed and pushed, now I'm already to go :D
Pre-Flight Checks
I knew that I'd already installed some things like homebrew, z etc.. So rather than running the full install-deps.sh
file I opened it instead and added the bits I was missing and double checked the others.
If you'd like to run the file you can do this by doing (changing path/to/file to where the file is):
1 | sudo bash path/to/file |
Going The .extra Mile
Next up the .extra
file and where my n00bness kicks in…
After backing up all my existing dotfiles, I guessed the new ones would need to go where they were, so I created the .extra
file there as per Paul's with the following code:
1 | # PATH like a bawss |
Don't seem to have an opt
folder, not exactly sure what that's for, but carried on.
Pretty Colours
Syntax highlighting = Yes, please.
OS Se.X.y
Sensible OS X defaults = Going to leave this one till last, after reading over it the first time I had a grin the size of a Cheshire Cat.
Take Off!!!
Opened up a new terminal, made sure I was in my user home directory:
1 | cd ~ |
Then ran the sync.sh:
1 | git clone https://github.com/simonowendesign/dotfiles.git && cd dotfiles && ./sync.sh |
But.. oh no :( Got the following errors:
1 | /Users/simonowen/.bash_prompt: line 66: dirname: command not found |
Tried running grep
, command not found, then came up a directory to see what happen and it worked:
1 | simon-owens-MacBook-Pro:dotfiles simonowen$ simon-owens-MacBook-Pro:dotfiles simonowen$ grep |
Tried running the sync.sh again:
1 | sudo bash dotfiles/sync.sh |
But got the same errors…
So why is it not working?
Thinking possibly something to do with the .extra
file and PATHS, Mathias also had an .extra
file:
1 | # PATH additions |
After updating his details to mine, tried again, then got:
1 | simon-owens-MacBook-Pro:~ simonowen$ sudo bash dotfiles/sync.sh |
No errors… hmmm… did it work?
Tried doing ..
which should now be the equivelant of cd ..
:
1 | simon-owens-MacBook-Pro:~ simonowen$ .. |
Nope :( Would be nice if someone could let me know what was going on here :)
Let's try switching it off and on again!
Restarted, opened up terminal and… what's this??
1 | ~ |
Hmmm… ok, that's different, let's try some stuff:
1 | $ pwd |
Yes, yes, yes, boom, boom… BOOM!
Woooohooo!!! Looking good :D
So what I just did was:
pwd
to show me the present working directory
.
Instead of doing cd ..
, I'm now able to just do ..
.
Then used z
to find a Git directory and go directly to it.
Then g
instead of git
, but I need to add in some previous aliases I'd set to change st
to status
. Lucky I backed up all my dotfiles ;)
Then was able to do pull
.
Finally slt
took me into Sublime Text 2…
Mother Effing Awesome
And there you go! https://github.com/simonowendesign/dotfiles
Next… .osx
Browse by category:
- apple1
- bash1
- browser1
- case study4
- chrome2
- chrome dev tools4
- clojure overtone2
- conference2
- css2
- dev tips1
- digihike1
- dotfiles2
- event4
- ffconf1
- freelance6
- gaming2
- health3
- hexo1
- https1
- jank1
- javascript1
- jobs1
- lego1
- mcrfred107
- nux1
- octopress4
- photography2
- raspberry pi1
- responsive web design1
- sass1
- screencast1
- speaking2
- svg4
- unplugged6
- upfrontconf1
- web development2
- webgl1
- wordpress17
- work51
- workflow16