michelegera’s dotfiles
These are the base dotfiles that I start with when I set up a new environment.
For more specific local needs I use the *.local
files described in the
Local Settings section.
Some commands (e.g. defaults write
) won’t work unless the terminal has full
disk access. To grant full disk access to the terminal, go to
System Settings > Privacy & Security > Full Disk Access
and add the terminal
to the list of apps.
To set up the dotfiles run the appropriate snippet in the terminal:
[!CAUTION]
DO NOT run the setup
snippet if you do not fully understand
what it does. Seriously, DON’T!
bash -c "$(curl -LsS https://setup.dotfiles.michelegera.dev)"
That’s it! ✨
The setup process will:
- Download the dotfiles on your computer (by default it will suggest
~/Code/$(whoami)/dotfiles
) - Create some additional directories
- Symlink the Git, prefs, and shell files
- Install applications and command-line tools
- Set custom preferences preferences
The dotfiles can be easily extended to suit additional local requirements by using the following files:
The ~/.fishconfig.local
file will be automatically sourced after the standard
Fish configuration, thus, allowing its content to add to or overwrite
the existing aliases, settings, PATH
, environment variables etc.
Here is an example:
# Set local aliases.
alias g="git"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Set environment variables.
set -x NPMJS_AUTH_TOKEN xxxxxxxx
The ~/.gitconfig.local
file will be automatically included after the
configurations from ~/.gitconfig
, thus, allowing its content to overwrite or
add to the existing Git configurations.
Note: Use ~/.gitconfig.local
to store sensitive information such as the
Git user credentials, e.g.:
[commit]
# Sign commits using GPG.
# https://help.github.com/articles/signing-commits-using-gpg/
gpgSign = true
[user]
name = John Appleseed
email = john.appleseed@apple.com
signingKey = XXXXXXXX
First, make sure permissions are set correctly on the .gnupg
directory:
chmod -R go= ~/.gnupg/
Next, import your private GPG key:
gpg --import <key-file>
Finally, set user.signingKey
in ~/.gitconfig.local
to the short id of your
key. You can find it by running:
gpg --list-secret-keys --keyid-format SHORT
If you decide to fork this project, do not forget to substitute my username
with your own in the setup
script.
To update the dotfiles you can either run the setup
script or, if you
want to update one particular part, run the appropriate os
script.
Inspiration and code was taken from many sources, but mainly Cătălin Mariș’ dotfiles. Thank you for your amazing work!
The code is available under the MIT license.