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:
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?
@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
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):
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:
# PATH like a bawss
Don't seem to have an
opt folder, not exactly sure what that's for, but carried on.
Syntax highlighting = Yes, please.
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.
Opened up a new terminal, made sure I was in my user home directory:
Then ran the sync.sh:
git clone https://github.com/simonowendesign/dotfiles.git && cd dotfiles && ./sync.sh
But.. oh no :( Got the following errors:
/Users/simonowen/.bash_prompt: line 66: dirname: command not found
grep, command not found, then came up a directory to see what happen and it worked:
simon-owens-MacBook-Pro:dotfiles simonowen$ simon-owens-MacBook-Pro:dotfiles simonowen$ grep
Tried running the sync.sh again:
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
# PATH additions
After updating his details to mine, tried again, then got:
simon-owens-MacBook-Pro:~ simonowen$ sudo bash dotfiles/sync.sh
No errors… hmmm… did it work?
.. which should now be the equivelant of
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??
Hmmm… ok, that's different, let's try some stuff:
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
z to find a Git directory and go directly to it.
g instead of
git, but I need to add in some previous aliases I'd set to change
status. Lucky I backed up all my dotfiles ;)
Then was able to do
slt took me into Sublime Text 2…
Mother Effing Awesome
And there you go! https://github.com/simonowendesign/dotfiles
Browse by category:
- case study4
- chrome dev tools4
- clojure overtone2
- dev tips1
- raspberry pi1
- responsive web design1
- web development2