User Guide: Setting Up Your Mac Development Environment 🚀
This guide will help you use the dotFile
scripts to set up your Mac for development. Follow these steps to install tools, configure settings, and get ready to code!
Prerequisites: Things to Do First ✅
Before starting, make sure you've completed these steps:
- Set Up Your Mac: Complete the macOS startup wizard (language, Wi-Fi, Apple ID, user account).
- Connect to the Internet: Ensure your Mac is online.
- Open Terminal: Go to
Applications > Utilities
and openTerminal.app
. - Install Xcode Command Line Tools:
- These tools are required for Homebrew and other installations.
- Run this command in Terminal:
xcode-select --install
- A pop-up window will appear. Click "Install" and agree to the terms.
- Wait for the installation to finish completely before moving on.
Step 1: Choose a Folder for Your Code (GIT_HOME
) 📂
Decide where you want to store all your coding projects. Common choices are ~/projects/git
or ~/Code
. For this guide, we'll use ~/projects/git
.
Step 2: Download the dotFile
Repository 📥
-
Fork the Repository:
- Why Fork? Forking creates your own personal copy of this repository under your GitHub account. This allows you to save your customizations (like your specific dotFile, package lists,
.env
file content) without affecting the original project. - How: Go to the main page of the original repository on GitHub. Click the "Fork" button near the top-right. Choose your GitHub account as the owner for the fork.
- Why Fork? Forking creates your own personal copy of this repository under your GitHub account. This allows you to save your customizations (like your specific dotFile, package lists,
-
Clone Your Fork: Now, download the code from your forked repository to your local Mac.
- Choose Location: Decide where you want to store your code projects (e.g.,
~/Projects
,~/Code
,~/projects/git
). This will be yourGIT_HOME
. - Clone Command: Open Terminal and run
git clone
, replacing<your-fork-url>
with the SSH or HTTPS URL of your forked repository (get it from the "Code" button on your fork's GitHub page). It's recommended to name the local directorydotFile
.
# Example: If your chosen code directory is ~/projects/git # Ensure the parent directory exists first mkdir -p ~/projects/git # Navigate into it cd ~/projects/git # Clone YOUR FORK, naming the local folder 'dotFile' # Replace <your-fork-url> with the actual URL from YOUR fork! git clone <your-fork-url> dotFile
- You now have the setup files locally, typically at
~/projects/git/dotFile/
.
- Choose Location: Decide where you want to store your code projects (e.g.,
-
Your Terminal prompt should now show you're inside
~/Projects/dotFile
.
Step 3: Create Your Secret .env
File 🤫
This file stores your personal information (like your Git name and email). Follow these steps:
- Make sure you're inside the
dotFile
folder:# Example: If your chosen code directory is ~/projects/git cd ~/Projects/dotFile
- Create the
.env
file:touch .env
- Open the file for editing:
nano .env
- Add the following lines, replacing the placeholders with your actual details:
# --- REQUIRED --- # Path to your code folder GIT_HOME="/Users/your_mac_username/projects/git" # Your name for Git commits GIT_AUTHOR_NAME="Your Name" # Your email for Git commits GIT_AUTHOR_EMAIL="your.email@example.com"
- Replace
your_mac_username
with your macOS username. - Double-check the
GIT_HOME
path is correct.
- Replace
- Save and exit
nano
:- Press
Ctrl+X
, typeY
, and pressEnter
.
- Press
Step 4: Prevent .env
from Being Shared 🚫
To ensure your .env
file isn't accidentally shared:
- Run this command:
echo ".env" >> .gitignore
- (Optional) Save this change to your repository:
git add .gitignore git commit -m "Ignore .env file"
Step 5: Customize Your Settings 🛠️
The dot/
folder contains configuration files that will be applied to your system. Review and edit them as needed:
- Check
dot/.zshrc
:- Ensure the
plugins=(...)
line includes useful plugins like:plugins=(git zsh-autosuggestions zsh-syntax-highlighting autojump)
- Set the theme to:
ZSH_THEME="powerlevel10k/powerlevel10k"
- Ensure the
- Edit
dot/.aliases
:- Add shortcuts for commands you use often.
- Edit
dot/.gitignore_global
:- Add patterns to ignore files globally, like:
*.log .DS_Store
- Add patterns to ignore files globally, like:
Step 6: (Optional) Customize Python Packages 🐍
If you use Python, check python/requirements.txt
. Add or remove libraries you want installed by default.
Step 7: Run the Setup Script ✨ (run_all.sh
)
-
Navigate to Script Directory:
# Use the path where you cloned the repo cd ~/projects/git/dotFile/scripts
-
Execute
run_all.sh
: Choose a mode:- Interactive Mode (Select Scripts): Shows a menu to choose specific scripts (0-8) or
all
. Warning: Selecting individual scripts runs only those scripts; dependencies are NOT automatically included. Use with caution.bash run_all.sh
- Interactive Mode (Select Scripts): Shows a menu to choose specific scripts (0-8) or
-
Follow Prompts: Enter your
sudo
password and potentially your user password (chsh
) when requested. -
Wait: Installation takes time.
Final Steps After Installation 🏁
- Restart Your Terminal: Quit Terminal completely (
Cmd+Q
) and reopen it. This ensures all settings are applied. - Add SSH Key to GitHub: If script
08
ran, copy the public key it printed and add it to your GitHub account settings online.- Copy your public SSH key:
cat ~/.ssh/id_ed25519.pub
- Add it to your GitHub account:
Settings > SSH and GPG keys > New SSH key
.
- Copy your public SSH key:
- Log into Apps: Open and sign into apps like Docker, Dropbox, and Google Drive.
- Explore Your Setup: Start using tools like Conda, Git, and Zsh plugins. Customize VS Code and other tools as needed.
You're all set! Enjoy your streamlined Mac development environment. 🎉