Setting Up Your Development Environment on Mac
A well-configured development environment makes coding significantly easier and more enjoyable. Taking time to set up your tools properly will save you hours of frustration later.
As a Mac user, you're already in a good position for development work. macOS comes with many developer-friendly features built-in, and setting up your environment is relatively straightforward. This section will guide you through setting up everything you need for effective vibe coding.
Terminal Setup
The Terminal app is your command center for development tasks. Here's how to get started:
Basic Terminal Configuration
-
Open Terminal: Find it in Applications > Utilities > Terminal, or use Spotlight (Cmd+Space) and type "Terminal"
-
Install Command Line Tools: Run this command to install essential development tools:
xcode-select --installThis installs Git and other developer tools without requiring the full Xcode application.
-
Install Homebrew: Homebrew is a package manager that makes it easy to install development tools. Install it with:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Configure your PATH: After installing Homebrew, make sure to follow the instructions it displays to add it to your PATH.
Essential Terminal Commands
Here are some commands you'll use frequently:
| Command | Description |
|---|---|
cd [directory] |
Change to a specific directory |
cd .. |
Move up one directory |
ls |
List files in current directory |
ls -la |
List all files (including hidden ones) with details |
mkdir [name] |
Create a new directory |
touch [filename] |
Create a new empty file |
rm [filename] |
Remove a file |
rm -rf [directory] |
Remove a directory and all its contents (use with caution!) |
cp [source] [destination] |
Copy a file |
mv [source] [destination] |
Move or rename a file |
cat [filename] |
Display file contents |
nano [filename] |
Edit a file using a simple text editor |
Code Editor Setup
A good code editor with AI capabilities will dramatically improve your productivity. The right editor can help you write better code faster and catch errors before they become problems.
While you mentioned using Cursor, which is excellent for AI-assisted coding, here's how to set up some popular alternatives:
Visual Studio Code
VS Code is highly recommended for its balance of features, performance, and AI integration:
-
Install VS Code: Download from code.visualstudio.com or use Homebrew:
brew install --cask visual-studio-code -
Essential Extensions:
- GitHub Copilot: AI pair programming assistant
- Prettier: Code formatter
- ESLint: JavaScript linter
- Live Server: Launch a local development server
- Auto Rename Tag: Automatically rename paired HTML tags
- Path Intellisense: Autocompletes filenames
-
Configure Settings: Press
Cmd+,to open settings, where you can customize editor behavior.
Cursor
Since you mentioned Cursor, here are some tips for optimizing it:
-
Install Cursor: Download from cursor.sh or use Homebrew:
brew install --cask cursor -
AI Features: Familiarize yourself with:
- Command+K to open the AI chat
- Command+L to generate code in-line
- Command+I to explain selected code
-
Keyboard Shortcuts: Learn the essential shortcuts to boost productivity.
Node.js and npm Setup
Node.js is essential for JavaScript development and running many web applications:
-
Install Node.js and npm: Use Homebrew for easy updates:
brew install node -
Verify Installation:
node -v npm -v -
Update npm (optional):
npm install -g npm@latest
Git Setup
Git is crucial for version control and working with code repositories:
-
Configure Git:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com" -
Basic Git Commands:
git init- Initialize a new Git repositorygit clone [url]- Clone a repositorygit add .- Stage all changesgit commit -m "Message"- Commit staged changesgit push- Push commits to remote repositorygit pull- Pull changes from remote repository
Project Management
Organizing your projects effectively will save you time and frustration:
-
Create a dedicated projects folder:
mkdir ~/Projects -
Use consistent project structure:
project-name/ ├── README.md ├── index.html ├── css/ │ └── style.css ├── js/ │ └── script.js └── assets/ ├── images/ └── fonts/ -
Document your projects: Create a README.md file for each project with:
- Project description
- Setup instructions
- How to use the application
- Technologies used
Browser Developer Tools
Modern browsers include powerful developer tools:
-
Access Developer Tools:
- Safari: Preferences > Advanced > Show Develop menu, then Develop > Show Web Inspector
- Chrome: View > Developer > Developer Tools (or Cmd+Option+I)
- Firefox: Tools > Web Developer > Toggle Tools (or Cmd+Option+I)
-
Key Features to Learn:
- Elements panel: Inspect and modify HTML/CSS
- Console: View logs and run JavaScript
- Network: Monitor network requests
- Application: Inspect storage (localStorage, cookies)
Setting Up for Specific Project Types
Web Development
For basic web development, you already have everything you need with a code editor and browser. For more advanced projects:
-
Install live-server for automatic browser refreshing:
npm install -g live-serverUse it by navigating to your project folder and running
live-server -
Consider a CSS preprocessor like Sass:
npm install -g sass
React Development
For React projects:
-
Install Create React App:
npm install -g create-react-app -
Create a new React project:
npx create-react-app my-app cd my-app npm start
Next.js Development
For Next.js projects:
-
Create a new Next.js project:
npx create-next-app my-nextjs-app cd my-nextjs-app npm run dev
Troubleshooting Common Setup Issues
Permission Issues
If you encounter "permission denied" errors:
sudo chown -R $(whoami) /usr/local/lib/node_modules
Path Issues
If commands aren't found after installation:
-
Check your PATH variable:
echo $PATH -
Add to PATH in your profile file (~/.zshrc or ~/.bash_profile):
export PATH="/usr/local/bin:$PATH"
Installation Failures
If Homebrew installations fail:
brew doctor
Follow the recommendations to fix issues.
Development Environment Best Practices
-
Keep software updated:
brew update && brew upgrade -
Use version managers for languages with multiple versions:
- nvm for Node.js
- pyenv for Python
- rbenv for Ruby
-
Back up configuration files:
- Use Git to track your dotfiles
- Consider a tool like Mackup
-
Learn keyboard shortcuts for your most-used applications