/dotfiles

Primary LanguageShellMIT LicenseMIT

Dotfiles

Lines of code GitHub made-with-bash GitHub last commit

This repository works helps me configure and maintain my Mac. It simplifies the effort of install my preferred MacOS flavour manually. Feel free to explore, learn and copy parts to your own dotfiles. Enjoy! 😄

Installation

Warning: If you want to give these dotfiles a try, you should first fork this repository, review the code, and remove things you don’t want or need. Don’t blindly use my settings unless you know what that entails. Use at your own risk!

To install and setup your MacOS:

bash <(curl -s https://raw.githubusercontent.com/HansJoakimPersson/dotfiles/master/bootstrap.sh)

To update, cd into your local dotfiles repository and rerun:

sh bootstrap.sh

The setup script is smart enough to back up your existing dotfiles into a ~/dotfiles_old/ directory if you already have any dotfiles of the same name as the dotfile symlinks being created in your home directory.

Add custom commands without creating a new fork

If ~/.extra exists, it will be sourced along with the other files. You can use this to add a few custom commands without the need to fork this entire repository, or to add commands you don’t want to commit to a public repository.

My ~/.extra looks something like this:

# Git credentials
# Not in the repository, to prevent people from accidentally committing under my name
GIT_AUTHOR_NAME="Joakim Persson"
git config --global user.name "$GIT_AUTHOR_NAME"

GIT_AUTHOR_EMAIL="mail@mailinator.com"
git config --global user.email "$GIT_AUTHOR_EMAIL"

You could also use ~/.extra to override settings, functions and aliases from my dotfiles repository. It’s probably better to fork this repository instead, though.

Aliases and Functions

To keep things easy, the ~/.bashrc and ~/.bash_profile files are extremely simple, and should never need to be modified. Instead, add your aliases, functions, settings, etc into corresponding file. They're all automatically sourced when a new shell is opened. Take a look, I have a lot of aliases and functions. I even have a fancy prompt that shows the current directory, time and current git/svn repo status.

¯\(ツ)/¯ Warning / Liability

Warning: The creator of this repo is not responsible if your machine ends up in a state you are not happy with. If you are concerned, look at the code to review everything this will do to your machine :)

Feedback

Suggestions/improvements welcome!

Thanks to…

I first got the idea for starting this project by visiting the Github does dotfiles project. Both Zach Holman and Mathias Bynens were great sources of inspiration.

License

The MIT License. Please see the license file for more information.