Show hidden folders and files on MacOS
defaults write com.apple.finder AppleShowAllFiles true; killall Finder
xcode-select --install
- Login to the macOS desktop system and install Homebrew on your system (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/USERNAME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
- Remove existing Node Versions
brew uninstall --ignore-dependencies node
brew uninstall --force node
- Install NVM on macOS
brew update
brew install nvm
- Create a directory for NVM in home
mkdir ~/.nvm
- Edit the following configuration file in your home directory
vim ~/.zshrc
Add the following lines to .zshrc
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
- Reload zsh
exec zsh
- Install Node.js with NVM
nvm ls-remote ## See what Node versions are available to install
nvm install node ## Installing Latest version
nvm install 14 ## Installing Node.js 14.X version
nvm ls ## After installing you can verify what is installed with
nvm use 14 ## To set the node 14.X as default version
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- More themes
- Install the recomended MesloLGS fonts
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
- Set
ZSH_THEME="powerlevel10k/powerlevel10k"
in ~/.zshrc. - Configure p10k:
p10k configure
.
To set up Git Bash on Windows, follow these steps:
- Download the Git for Windows installer from the official website.
- Run the installer and select the desired components. Make sure the “Git Bash” option is selected.
- Follow the rest of the installer prompts to complete the installation.
- Download the latest Zsh package from the MSYS2 package repository. The file will be named something like “zsh-5.8–5-x86_64.pkg.tar.zst”.
- Install an extractor that can open TAR and ZST archives, such as 7-Zip and facebook/zstd (named something like “zstd-v1.5.2-win64.zip”). First, use zstd to extract the TAR file. Later, use 7-Zip to extract the files into the Git Bash directory.
- Extract the archive’s files using 7-Zip (which should include etc and usr folders) into your Git Bash installation directory. This directory is usually located at "C:\Program Files\Git". If asked, merge the contents of the folder (no files should be overwritten).
- Open Git Bash and test Zsh:
zsh
.
IMPORTANT: Configure tab completion and history in Zsh using the first-use wizard. If, for some reason, it doesn’t appear, or you skipped it, re-run it:
autoload -U zsh-newuser-install
zsh-newuser-install -f
Create/edit the ~/.bashrc file: code ~/.bashrc
.
Add the following content to the file:
if [ -t 1 ]; then
exec zsh
fi
Save the file and close Git Bash. Once Zsh is installed and set as the default shell, you can access it by opening Git Bash. Now, your Git Bash will open a Zsh terminal.
On VS Code settings, search for "Terminal > External: Windows Exec" and point to: C:\Program Files\Git\git-bash.exe
.
Then look for "Terminal > Integrated > Automation Profile: Windows" and edit settings.json to add:
"terminal.external.windowsExec": "C:\\Program Files\\Git\\git-bash.exe",
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.shellIntegration.decorationsEnabled": "both",
"terminal.integrated.stickyScroll.enabled": true,