-
Notifications
You must be signed in to change notification settings - Fork 0
setup
This guide shows how I set up and customise a new Mac for coding, as well as some Windows equivalents.
Start installing Visual Studio Code.
Open Terminal and:
- set preferred theme (I use Ocean)
- make the window size larger, for example, 120 x 48
- set the profile to open on restart
- go to your home directory and create a .zshrc file:
touch .zshrc(you'll use this later to customise Terminal) -
mkdir projectsto create a projects folder -
cd projectsto enter the directory
In general, with Terminal, if you've installed or reconfigured something, you'll often need to restart Terminal for the changes to take effect.
Then install more tools. Each one might take some time:
- Command Line Developer Tools - essential for computery things. One way to do this is
git --version(which prompts you to install the tool) orxcode-select --install - Homebrew - to help you install other things
- Git:
brew install git
Read Alan Cruikshanks' Git setup guide and:
- set user name
- set email address as the no-reply one
Create or clone the repo you're going to work with. For example, go to projects and git clone https://github.com/andrewhick/reference.git
On first push you'll need to set up authentication using a personal access token:
- set up your personal access token
- cache your personal access token in your keychain
More information about working with Git
brew install rbenv-
rbenv install -lto get a list of latest stable versions. If the version you want isn't there, then run brew upgrade ruby-build.rbenv -
rbenv install 3.3.0(or whatever the latest version is) -
rbenv global 3.3.0(set the global default version) - add
eval "$(rbenv init - zsh)"to .zshrc - restart Terminal
-
gem install bundler- installs the thing that helps you install things -
bundle install- installs all the things you need for your current repository, based on your repository's Gemfile.lock file
If things don't work, then a combination of the following might help:
bundle installbundle update- restart Terminal
- reinstall Ruby
(For example, Middleman uses Node)
brew install node
The right way to install Python on a Mac
brew install pyenv pyenv-virtualenv
pyenv install x.x.xYou can either edit Settings using the user interface or a JSON file. To edit the JSON file, open settings and look for then look for an icon in the top right (curled arrow pointing at document) which opens the custom settings.json file.
I use the following:
{
"editor.tabSize": 2,
"editor.scrollBeyondLastLine": false,
"editor.wordWrap": "on",
"explorer.confirmDelete": false,
"files.autoSave": "afterDelay",
"files.enableTrash": false,
"editor.selectionHighlight": true,
"editor.occurrencesHighlight": "off", // stops similar words being highlighted on click
"update.showReleaseNotes": false,
"workbench.colorCustomizations": {
"editorBracketMatch.background": "#00ff",
"editorBracketMatch.border": "#00ff",
"editor.selectionBackground": "#26cf", // makes the current selection more prominent
"editor.selectionHighlightBackground": "#000e", // less prominent formatting for words similar to those selected
"editor.selectionHighlightBorder": "#ccfc" // less prominent formatting for words similar to those selected
},
"workbench.colorTheme": "Tomorrow Night Blue",
"workbench.editor.tabSizing": "shrink",
"workbench.iconTheme": "vscode-icons" // requires extension
}Extensions you might want to install:
- language interpreters for the languages you're working with
- vscode-icons: adds nice icons.
Also it might be useful to run Code from the shell (command line): https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line (needed for interactive commands like rebase).
For example, you might want to type be instead of bundle exec:
- open .zshrc
- add, for example,
alias be='bundle exec' - restart terminal
- Set Finder to show folders at top of window (Finder > Settings > Advanced)
- Set up tabbing for accessibility testing
- install / update VS Code
- open command prompt (start, cmd) or PowerShell
- set preferred layout - in cmd, right click title bar and select Properties
- try
git --versionto see if Git is installed or needs updating - install Ruby via RubyInstaller (the MSYS2 addon is useful to help install things)
- install Node.js. This includes installing
chocolateywhich is similar to Homebrew on Mac.