These are my dot files.
Mainly for my own references but you might find something useful.
Cheers! ✌️
This is the official Borgenfalk & Skott macOS setup guide, to help you set up your dev environment as fast as possible.
Why does this document exist? This is for the times when get a new computer and don't want to remember all the tools and steps that are needed to get your environment like you want it. So instead of googling and trying to remember what and how to install, simply follow this "well structured" guide.
-
First things first, login to your Apple ID and iCloud account so your documents and data can start syncing.
-
Turn on FileVault in System Settings -> Privacy & Security, to encrypt the data on your disk.
-
Turn on the Firewall in System Settings -> Network -> Firewall.
-
Download and install 1Password so your login credentials are easy to access for the rest of the guide.
-
Download and install Google Chrome web browser and sign in to your profile.
-
Download Xcode from the macOS App Store, or from Apple's website. When it has completed, install the Xcode cli tools with
xcode-select --install
. -
Login to your other accounts (e-mail, calendar, notes) in System Settings -> Internet Accounts so the data can start syncing.
Install the cli tool Oh My Zsh to boost your terminal with nice auto-completions, themes, plugins and much more. Follow the "Basic Installation" in their docs. Either go with the default theme or select one from the wiki Themes.
Install Homebrew, the missing package manager for macOS.
# list all installed brew packages
brew list
# list all brew services (running and stopped)
brew services list
When Homebrew is installed, tap
the Casks of Fonts and install the fonts you need.
# You only need to do this once!
brew tap homebrew/cask-fonts
# install the fonts
brew install font-inconsolata
brew install font-fira-code
brew install font-hack-nerd-font
Install the latest or a specific version of Php.
# latest version
brew install php
# a specific version
brew install [email protected]
# Load the version of php you need in ~/.zshrc
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"
Install MySQL database distribution MariaDB.
brew install mariadb
# login with sudo/root - use your computer password!
sudo mysql -u root -p
# create new user
CREATE USER 'dev'@'localhost' IDENTIFIED BY 'dev';
# give privileges to new user "dev"
GRANT ALL PRIVILEGES ON * . * TO 'dev'@'localhost';
# don't forget to flush
FLUSH PRIVILEGES;
# logout
exit
# restart mariadb
brew services restart mariadb
# Stopping `mariadb`... (might take a while)
# ==> Successfully stopped `mariadb` (label: homebrew.mxcl.mariadb)
# ==> Successfully started `mariadb` (label: homebrew.mxcl.mariadb)
Download and install Composer, the package manager for php.
After the installation completes, follow the steps for a global install.
Make sure the Composer vendor dir is in your "PATH".
# add vendor dir to your PATH in: ~/.zshrc
export PATH="$PATH:$HOME/.composer/vendor/bin"
Install Laravel Valet.
When Valet is installed, setup your local projects like below.
# go to the web root of your project
cd ~/bucket/my-project/bedrock/web
# create symlinks
valet link borgenfalkskott-se
valet link borgenfalkskott-com
# create TLS certs
valet secure borgenfalkskott-se
valet secure borgenfalkskott-com
# list all valet sites
valet links
Install NVM so you can have multiple versions of Node/Npm installed at once and switch between them easily. Important! Don't install Node via Homebrew or the official installer, use NVM instead.
# After the installation completes, this should've been printed to your ~/.zshrc
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Setup your global git settings so your commits are assigned to your user.
Git comes pre-installed with macOS.
git -v
# git version 2.39.3 (Apple Git-146)
# set a global username
git config --global user.name "your_username"
# get the global username
git config --global user.name
# set a global email
git config --global user.email "your_email"
# get the global email
git config --global user.email
Follow the guide on how to setup SSH config and adding new SSH keys.
Download and install VS Code and add the extensions you need, from the list below.
Open them in VS Code Marketplace or check the "Recommended extensions" tab in VS Code.
You can import/export different profiles in VS Code but it's kind of buggy on macOS and VS Code defaults back to the default profile every time you restart VS Code (bug?). So for that reason, we are replacing our default settings instead of importing a new profile, so we don't have switch profile all the time.
- Open VS Code with your default profile active and open settings
cmd + ,
. - Search for the setting to show settings as json instead of ui:
"workbench.settings.editor": "json"
. - Open your settings again but this time it should open in json format.
- Copy and paste the contents of settings.json to your settings.json in VS Code and save.
- Open Settings -> Keyboard Shortcuts in VS Code and click the icon in the upper right to show keybindings as json format instead of ui.
- Copy and paste the contents of keybindings.json to your keybindings.json in VS Code and save.
Install the VS Code shell command in your PATH
to be able to open projects in VS Code from your terminal e.g. code my-project
. Open the command palette in VS Code by pressing cmd + shift + p
and search for Shell command: Install 'code' command in PATH
and run it.
Download and install iTerm2, for a more customizable terminal. Download and import a color scheme, I like the Dracula color sheme.
To prevent weird locale warnings when connecting to a VPS or similar, make sure to turn off the setting to set the locale automatically in Settings -> Profiles (Default) -> Terminal -> "Environment: Set locale variables automatically".
A list of links to some of the tools I use or have used before.