Setting Up a Mac for Development

Last update: 2025-02-18

Content

Installing iTerm2

Download iTerm2 from its official page: iTerm2.

Once downloaded, move the application to the "Applications" folder to complete the installation.


Installing Visual Studio Code

Download VSCode from: VSCode.

Recommended Extensions

🔹 Material Theme

🔹 Material Icon Theme

🔹 Prettier (for automatic code formatting)

To enable automatic formatting in VSCode:

1️⃣ Open settings with Cmd + ,

2️⃣ Search for "Format on Save" and enable it.

Enabling the code Command

To open files or folders from the terminal using code:

1️⃣ Open the terminal.

2️⃣ Press Cmd + Shift + P in VSCode.

3️⃣ Type "Install 'code' command in PATH" and execute it.


Installing Command Line Tools

Run in the terminal:

xcode-select --install

If they are already installed, you will receive a message indicating so.


Installing Homebrew

Install Homebrew by running:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

If Homebrew is not in your PATH, run:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/[username]/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Verify the setup with:

cat ~/.zprofile

Installing Oh My Zsh

Install Oh My Zsh with:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Installing PowerLevel10K Theme

git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

Edit the configuration file:

nano ~/.zshrc

Change the line:

ZSH_THEME="powerlevel10k/powerlevel10k"

Apply changes:

source ~/.zshrc

Switching Between Bash and Zsh

To check the current shell:

echo $0
echo $SHELL

To switch from Bash to Zsh:

chsh -s /bin/zsh

To switch from Zsh to Bash:

chsh -s /bin/bash

On newer macOS versions, the default shell is Zsh.


Installing Node.js Environment

Install NVM with:

brew install nvm

Configure NVM by editing the ~/.zshrc file and adding:

export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion"

Save the changes and reload the shell:

source ~/.zshrc

List hidden files to verify:

ls -a

Installing Node.js

To install a specific version of Node.js:

nvm install [version]

Check the LTS version on the official Node.js website and choose the recommended version for production.

With these steps, your Mac will be fully set up for software development. Happy coding! 🙌