This is my personal setup of a clean macOS Yosemite. Eventually I'd like to use this to personalize my Linux shell(s) as well.
Originally this was forked from Mathias Bynens' dotfiles, but it's since been added to and rewritten extensively.
❗ If you have customized your current environment, you should consider backing up your existing dotfiles.
A base installation of macOS Yosemite will include curl
, while git
will be installed automatically as part of the command line tools.
export DOTFILES_USER="greygore"; bash -c "$(curl -fsSL raw.github.com/$DOTFILES_USER/dotfiles/master/bootstrap.sh)"
DOTFILES_USER
to your Github username.
By default the script will install in the ~/.dotfiles
directory. An alternate location can be provided with the DOTFILES_DIRECTORY
variable. For example:
export DOTFILES_USER="greygore"; export DOTFILES_DIRECTORY="$HOME/dotfiles" bash -c "$(curl -fsSL raw.github.com/$GITHUB_USER/dotfiles/master/bootstrap.sh)"
.dotrc
file containting a DOTFILES_ROOT
variable.
Although you should consider forking this repository and customizing it to your own needs, the installation script will attempt to prompt you for user specific information, rather than using hard-coded values.
Currently, the exception to this is the macOS locale information. Don't worry: if you are not in the US (and the Eastern timezone), you'll be able to opt out of this. In the future I'll consider adding additional locale and timezone choices; if you want this, please file an issue.
Removing the symbolic links from your home directory will remove any dotfile customizations. Restore any backups that you surely made before running the install script to return to your original settings.
The macOS default settings are heavily commented, with some available options commented out entirely. Additional options for each setting are documented where available, as is the default value if available. For settings using defaults
, change write
to delete
to reset to the default system value. For example:
# Set scroll direction
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool true
# Default scroll direction
defaults delete NSGlobalDomain com.apple.swipescrolldirection
The command line tools are not easily removed, nor should it be necessary to remove them. Seriously, don't worry about it.
Some macOS customizations not using defaults
require additional commands to undo. Eventually there will be a macos_reset.sh
script to undo all these settings, but until then you'll have to Google the command to look for solutions.
If you chose to install packages, you'll have to remove them individually using the correct commands:
brew uninstall formula_name
brew cask uninstall cask_name
Although you should be able to remove Homebrew and all installed packages by deleting the directory it was installed to (/usr/local
by default), the Homebrew project recommends this simple script to remove everything.
- Creates a public/private SSH key
- Configures Git (
.gitconfig
)
All config files are symlinked into the home directory:
- Bash configuration
.bash_profile
- Main config, loads the following files frombash/
aliases
- Aliasescompletions
- Additions to tab completexports
- Environmental variablesfunctions
- Bash functionsoptions
- Bash optionspath
- Additions to$PATH
prompt
- Customized prompt
.bashrc
- Loads main config
- Git configuration
.gitattributes
- Path specific options.gitignore_global
- Git ignore file for all repos.gitmessage
- Default commit message template
- Run command (rc) configurations
.ackrc
.curlrc
.jshintrc
.screenrc
.wgetrc
- Miscellaneous
.editorconfig
- Portable text editor config.grc/
- Colorization options.hushlogin
- Stub file to skip copyright notice.inputrc
- Keybindings and readline behavior
- Installs command line tools
- Configures default OS settings
- Install programs via Homebrew
- Install applications via Cask
- Install Quicklook plugins via Cask
The custom bash prompt is based on the Solarized color palette. For best results be sure to use the included Terminal or iTerm2 theme.
When your current working directory is a Git repository, the prompt will display the checked-out branch's name (and failing that, the commit SHA that HEAD is pointing to). The state of the working tree is reflected in the following way:
Symbol | Meaning |
---|---|
+ |
Uncommitted changes |
! |
Unstaged changes |
? |
Untracked files |
$ |
Stashed files |
Further details are in the .bash_prompt
file.
- Remove hard-coded locale and/or allow selection of alternatives.
- Add zsh shell with oh-my-zsh/Prezto
- Create restore script to restore dotfile backups and revert macOS customizations
- Research duti for setting default applications for file types and URIs. More.
- Add to
cheat
andtldr
- Create/enforce coding standards (example, test exit values, Robust BASH)
- Add tests for library functions (assert)
- Investigate using a multi select menu in general case (example)
- Add .d/ support
- Ellipse-ize long paths in prompt
- PATH management
- Wrap rm to ensure we have an absolute path (starting with
~
or/
) when-f
- Script Terminal/iTerm
- http://osxnotes.net/
- Braumeister
- Liquid Prompt
- Other MacOS Settings (1) (2)
- whatis
Suggestions/improvements welcome!
- Roderik van der Veer for his Mountain Lion setup post which pointed me to...
- Mathias Bynens for his widely forked dotfiles
- Nicolas Gallagher whose dotfiles I shamelessly stole from
- Newton whose dotfiles provided a few ideas from a different perspective
- Ben Alman whose dotfiles contained more things I could learn from