This is the development environment set up for my MacBook. It contains configuration files (dotfiles) and scripts that will automatically restore my apps, IDE extensions and settings, GitHub credentials and system preferences whenever I need to set up a new MacBook.
If you find this useful, feel free to fork this repository and make it your own!
- Connect to the internet
- Update macOS to the latest version
- Log in to iCloud and enable iCloud Keychain
- Log in to the App Store
- Log in to GitHub and ensure that the password is saved in iCloud Keychain
- Clone this repository into the
~/.dotfiles
local directory usinggit clone https://github.com/tigeryst/dotfiles ~/.dotfiles
- Run the bootstrap installation with
~/.dotfiles/bootstrap.sh
- Restart the computer to ensure changes are applied
- Make sure that the dotfiles are up to date with the current set up
- Commit and push any changes to local repositories to GitHub
- Make a Time Machine backup
- Make sure all important files are uploaded to the cloud (Google Drive, iCloud, etc.)
These steps are automated with the bootstrap.sh
script.
- Install Xcode, Oh My Zsh and Homebrew.
- Install apps
- Install Visual Studio Code (VS Code) extensions
- Set up GitHub credentials
- Clone active Git repositories
- Install iTerm2 plugins
- Symbolic link Z Shell (Zsh), VS Code and Haskell interpreter configuration files
- Restore macOS settings
- Prompt to log in and sync with Google Drive
The set up steps are spread across various files and can be tweaked as needed. Keeping the dotfiles up the date also requires constant maintenance and a little different approach to installing apps and editing settings.
Apps should be managed through the Homebrew package manager.
- To remove an app, run
brew uninstall app_name
then make sure to remove the app from thebrew/Brewfile
- To install a new app, check if the app to install is available from the Homebrew directory and run 'brew install app_name' then make sure to add the app to the brew/Brewfile
- If the app is not available on Homebrew but is instead available on the App Store, install it from the App Store and add it to the Brewfile under the mas section
The brew/install.sh
script executes the Bew installations and starts background services such as MySQL or MongoDB databases.
Installation commands for the VS Code extensions is listed in the vscode/extensions.sh
script.
- When installing a new extension, make sure to append
code --install-extension extension_id
to the script. Extension ID can be copied from the extensions tab on VS Code. - When uninstalling an extension, make sure to remove the corresponding command from the script.
User settings for VS Code are symlinked to the vscode/settings.json
file so any settings changed from VS Code is automatically reflected in the file which is committed to this repo.
On a Mac, system settings are normally stored in Property List files (PLIST) in an XML key-value pair format. These settings can be read using defaults read domain_name key
and overwritten with defaults write domain_name key value
. Do an internet search to find the right command for the setting you are looking for.
The os/macos.sh
script contains such settings commands including region format, languages, menu bar, dock, keyboard and trackpad. Instead of updating settings through the System Settings UI, try to find the right command and add it to the script.
To configure how the Zsh looks and behaves, the theme, plugins and other settings can be configured in terminal/.zshrc
. Custom plugins are installed in terminal/install.sh
.
To add shorthand for commands or aliases, check out terminal/aliases.zsh
. The $PATH
variable is set in terminal/path.zsh
. These files get loaded in because the $ZSH_CUSTOM
setting points to the terminal
directory.
More info about how to customize Oh My Zsh can be found here.
I would like to thank Sourabh Bajaj for my current development set up, Dries Vints for the comprehensive starter code for my dotfiles allowing me to automate everything, Emmanuel Maggion for the command line Dock set up and Mathias Bynens for the original script to modify the macOS defaults.