Xcode is a large suite of software development tools and libraries from Apple.
The Xcode Command Line Tools are part of Xcode. Installation of many common Unix-based tools requires the GCC compiler.The Xcode Command Line Tools include a GCC compiler.
Open terminal an type
xcode-select --install
Zed Zed is a next-generation code editor designed for high-performance collaboration with humans and AI, written in Rust 🦀.
settings.json
file into the settingsZed > Install CLI Integration
Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js
Shell Command: Install 'code' command in PATH
and press EnterTurn on Settings sync
Create file called one-dark.itermcolors
on the ~/Desktop
and open it
zed ~/Desktop/one-dark.itermcolors
Homebrew is a package manager for macOS Linux.
Packages are bundles of source code distributed by developers of software, which can be compiled and installed on your machine.
brew doctor
brew update
(Note: the absolute paths will not be used after the next step, but might not be needed if they already have /usr/local/bin
in their $PATH)
Install Fish shell
brew install fish
Add the shell to /etc/shells
with
echo /usr/local/bin/fish | sudo tee -a /etc/shells
Change the default shell to Fish
chsh -s /usr/local/bin/fish
Confiigure iTerm to use Fish shell
Custom Shell
and type /usr/local/bin/fish
Load integration automatically
Run the following command to install Fisher:
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
Bass makes it easy to use utilities written for Bash in fish shell.
fisher install edc/bass
fisher rkbk60/onedark-fish
Create a file called config.fish
in the ~/.config/fish
directory
zed ~/.config/fish/config.fish
Add the following to the file
if status is-interactive
# Commands to run in interactive sessions can go here
set_onedark
end
# Homebrew
export HOMEBREW_PREFIX="/opt/homebrew"
# set editor
export EDITOR='zed -w -n'
export PAGER='less -f'
Type
brew install starship
Add following to ~/.config/fish/config.fish
# Starship configuration
starship init fish | source
To get started configuring starship, create the following file:~/.config/starship.toml
# Don't print a new line at the start of the prompt
add_newline = false
# Disable the package module, hiding it from the prompt completely
[package]
format = "via [🎁 $version](208 bold) "
[git_branch]
symbol = "🌱 "
[nodejs]
format = "via [🤖 $version](bold green) "
[directory]
truncation_length = 8
truncation_symbol = "…/"
[docker_context]
format = "via [🐋 $context](blue bold)"
[kotlin]
symbol = "🅺 "
[kubernetes]
format = 'on [🐳 $context \($namespace\)](bold green) '
disabled = false
[rust]
format = "via [⚙️ $version](red bold)"
[sudo]
style = "bold green"
symbol = "👩💻 "
disabled = false
[terraform]
format = "[🏎💨 $workspace]($style) "
A cat(1) clone with syntax highlighting and Git integration.
brew install bat
pyenv
Python Version Managerpyenv lets you easily switch between multiple versions of Python.
Install
brew install pyenv
brew install pyenv-virtualenv
set -Ux PYENV_ROOT $HOME/.pyenv
fish_add_path $PYENV_ROOT/bin
Set up shell environment for Pyenv in ~/.config/fish/config.fish
# Load pyenv
pyenv init - | source
alias brew="env PATH=(string replace (pyenv root)/shims '' \"\$PATH\") brew"
exec "$SHELL"
Check the latest python version and replace the semver number
pyenv install 3.11.1
pyenv global 3.11.1
pip install -upgrade pip
Open a terminal window and type:
Check the latest nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
Type source ~/.nvmrc
to include the new folders to the current $PATH
Read more here
# ~/.config/fish/functions/nvm.fish
function nvm
bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv
end
# ~/.config/fish/functions/nvm_find_nvmrc.fish
function nvm_find_nvmrc
bass source ~/.nvm/nvm.sh --no-use ';' nvm_find_nvmrc
end
# ~/.config/fish/functions/load_nvm.fish
function load_nvm --on-variable="PWD"
set -l default_node_version (nvm version default)
set -l node_version (nvm version)
set -l nvmrc_path (nvm_find_nvmrc)
if test -n "$nvmrc_path"
set -l nvmrc_node_version (nvm version (cat $nvmrc_path))
if test "$nvmrc_node_version" = "N/A"
nvm install (cat $nvmrc_path)
else if test "$nvmrc_node_version" != "$node_version"
nvm use $nvmrc_node_version
end
else if test "$node_version" != "$default_node_version"
echo "Reverting to default Node version"
nvm use default
end
end
~/.config/fish/config.fish
byload_nvm > /dev/stderr
Now that nvm is installed, we want to list the available versions, type:
nvm ls-remote
nvm install node
nvm install --lts
Check that Node is installed, type
node --version
nvm use
automatically in a directory with a .nvmrc
file addSince v16.13, Node.js is shipping Corepack for managing package managers.
Enable corepack
corepack enable
Install pnpm
corepack prepare pnpm@latest --activate
pnpm setup
Add the following to ~/.config/fish/config.fish
# pnpm
set -gx PNPM_HOME "/Users/pataruco/Library/pnpm"
if not string match -q -- $PNPM_HOME $PATH
set -gx PATH "$PNPM_HOME" $PATH
end
# pnpm end
Install Biome
brew install biome
.prettierrc.json
fileprettier
zed ~/.prettierrc
Copy and paste this configuration
Save file command + S.
prettier
packagesInstall the following prettier packages
pnpm --global add prettier
Just run this
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Git is the version control system that we will use throughout the course. It is one of the most powerful tools you will use as a developer.
brew install git
/usr/bin/git
by checking which git
and git --version
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Instead to have a global user email, we can set a different identity per repo.
git config --global --unset-all user.email
Set local config per repo
git config --global --add user.useConfigOnly true
Before the first commit on repo
git config --local --add user.email mail@example.com
main
git config --global init.defaultBranch main
git show
plugin (Delta)Delta provides language syntax-highlighting, within-line insertion/deletion detection, and restructured diff output for git on the command line.
brew install git-delta
Configure git to use delta adding the following to .gitconfig
:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
features = side-by-side line-numbers decorations
whitespace-error-style = 22 reverse
[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none
git-clean
Based on # Git Remove tracking branches no longer on remotE https://stackoverflow.com/a/33548037/4842303
Create a fish file function
zed ~/.config/fish/functions/git_clean.fish
Add the following function
function git-clean
git fetch -p
for branch in (git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}')
git branch -D $branch
end
end
.gitignore
There are a few files that we don’t want Git to track. We can specifically ignore them by adding the files to a global .gitignore
file.
.DS_Store
files are used by Mac OS X to store folder specific metadata information. They are different for every mac, it means that they often cause conflicts in version controlled folders.
Since we never want to track .DS_Store files, we can make a global .gitignore
file, and tell git to use it for all repositories:
echo .DS_Store >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
In the same way, we want to never track the contents of our uploads folder in Rails (which usually contain images or media that we have uploaded during testing) or our node_modules or bower_components.
echo "/public/uploads/\nnode_modules/\nbower_components/" >> ~/.gitignore_global
Enable auto-correct the suggested command will run after a short delay to give you the chance to cancel the command if it is not what you intended
git config --global help.autocorrect 20
GitHub is a web-based Git repository hosting service. It allows us to keep a remote version of our version-controlled projects. When we push and pull from Git, we don’t want to always have to login to verify who we are. Therefore, what we can do is generate and use something called an SSH key. SSH keys are a way to identify trusted computers, without involving passwords.
ls -al ~/.ssh
Check the directory listing to see if you have files named either id_rsa.pub or id_dsa.pub. If you have either of those files you can skip to the step ‘add your SSH key to Github’.
ssh-keygen -t rsa -C "your_email@example.com"
ssh-add ~/.ssh/id_rsa
pbcopy < ~/.ssh/id_rsa.pub
key
field - do not add or remove and characters or whitespace to the keyAdd key
and check everything works in the terminal by typing:
ssh -T git@github.com
pbcopy < ~/.ssh/id_rsa.pub
key
field - do not add or remove and characters or whitespace to the keySigning Key
.Add key
git config --global commit.gpgsign true
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_rsa.pub
During the course, we will be doing a lot of navigating using our keyboards. By default, the speed of the curson on a Mac is a little too slow. Let’s increase the speed of the cursor by going to:
System Preferences > Keyboard
Move both up to maximum.