Dotfiles
Basically dotfiles contain the preferred settings of your applications. They can save you much time when you setup your computer from a fresh system, or when you want to sync your settings on multiple devices.
OS X Preferences
My main OS is OS X. All my OS and its applications settings (Finder, Safari, Photos) are placed in my .osx
dotfile. To sync a new fresh system with
my preferences I just need to run source .osx
.
Homebrew
Homebrew is necessary when using OS X. It helps to install packages and tools easy way through the command line. For me it is the first thing that I install on a fresh OS X system.
Homebrew also can help to install apps with Homebrew Cask. It will download and install them automatically.
All your dependencies for your OS X system can be defined in a single Brefile
. It is like a composer.json
file, but for your Mac:
# Brefile
brew 'macvim'
cask 'item2'
These lines are equivalent to the following commands:
brew install macvim
brew cask install iterm2
Here is my own Brewfile, where all my installed apps and tools are
listed. Now I have to run simple command brew bundle
to install all my OS X dependencies on a fresh system.
Terminal and Shell
Customizing your shell is as important as customizing your IDE. I prefer to use Zsh. It is like Bash on steroids. And like we have frameworks for programming languages Zsh has it’s own frameworks of plugins and settings, and I prefer OhMyZsh. It has it’s own growing up community, a lot of different plugins and themes. I have chosen Agnoster theme and combined it with Solarized Dark color scheme for iTerm2.
Zsh configuration is located in zsh folder of my dotfiles. The main file
here is zshrc. Usually, your OhMyZSH settings and options are listed in the ~/.zshrc
configuration file.
Installation of OhMyZSH requires only one command:
curl -L http://install.ohmyz.sh | sh
Installation
- Install Xcode from the App Store, open it and accept the license agreement
- Install OS X Command Line Tools by running
xcode-select --install
- Copy public and private SSH keys to
~/.ssh
and make sure they’re set to 600 - Clone repo to
~/.dotfiles
- Run
./install.sh
./install.sh
will install Homebrew. Homebrew will start installing all the dependencies from Brewfile. Composer and npm will be installed with their global packages. At the end,
the osx
file will be sourced to set OS X settings.