Just a heads up, this setup is obviously very tailored to me. Therefore, it's probably best to fork this repository so you can tweak it to suit your needs π.
Do the following in orderβ¦
- Dotfiles and shell scripts
- ο£Ώ β About This Mac
- macOS defaults
- System preferences
- Finder
- Safari
- TextEdit
- Xcode command line tools
- Homebrew and formulae
- Sync Dropbox
- Non-Homebrew applications
- Set default app for file types
- GitHub SSH key
- NVM
- Multiple NPM tokens
- Visual Studio Code
- 1Password
- Symlinks
- Lifesavers
- Credits
Run these commands to install but make sure to swap out the repository URL (in step 2) for your forked repository URL:
cd ~/Projects
git clone https://github.com/chris-pearce/MBP-setup.git
cd MBP-setup
source bootstrap.sh
Steps 1β3 simply clone the repository to where you specify in step 1 (can be anywhere you like). In step 4, the bootstrap.sh
does the following:
- Get's latest of the remote
master
branch. - Copies (not symlinks) the dotfiles and relevant shell script files to your home folder.
- Runs
source ~/.bash_profile
to load.bash_profile
which in turn loads the rest of the relevant dotfiles.
Each file is well commented to help understand what's going on.
Important! Don't update the files in your home folder. If you need to make any updates then make them to the files in the folder where you cloned the repository (step 1β3 above).
Everytime you make an update to a dotfile and shell script file (except for bootstrap.sh
) you'll need to run source bootstrap.sh
. Additionally, source bootstrap.sh
will automatically run when you pull changes from your remote repository.
- If
~/.path
exists, it'll be sourced along with the other files before any feature testing takes place (such as detecting which version ofls
is being used). - If
~/.extra
exists, it'll be sourced along with the other files. Use this to add commands you donβt want to commit to a public repository (it's added to.gitignore
).
- Select: Software Updateβ¦.
- Recommendations:
- Turn on: Empty Trash Automatically.
- Applications:
- Remove:
- iMovie.
- GarageBand.
- Remove:
$ cd ~
$ source macos.sh
- Select: Ask to keep changes when closing documents.
- Remove all unwanted apps (right mouse clock β Remove from dock).
- Select: Magnification.
- Minimize windows using: Scale effect.
- Prefer tabs when opening documents: Always.
- Select: Automatically hide and show the Dock.
- Dashboard: As Space.
- Hot Corners:
- TL: Mission Control.
- TR: Launchpad.
- BL: Put Display to Sleep.
- BR: Dashboard.
- Time format: 24-Hour Time.
- General:
- Require password: immediately after sleep or screen saver begins.
- Allow apps downloaded from: App Store.
- FileVault:
- Turn on.
- Firewall:
- Turn on.
- Privacy:
- Location Services:
- Select: Weather.
- Analytics:
- Deselect everything.
- Deselect: Allow Spotlight Suggestions in Look up.
- Do Not Disturb:
- Select: When the display is sleeping.
- Mail and Messages:
- Deselect: Show message preview.
- All Applications:
- Use Banners.
- Deselect: Show notifications on lock screen.
- Night Shift:
- Schedule: Custom.
- From: 18:00β05.30.
- Battery:
- Select: Enable Power Nap while on Battery Power.
- Keyboard:
- Touch Bar shows: App Controls with Control Strip.
- Customize Control Strip: Add Screen Lock.
- Shortcuts:
- Full Keyboard Access: In windows and dialogs, press Tab to move keyboard focus between: All controls.
- Point & Click:
- Look up & data selectors: Force Click with one finger.
- Secondary click: Click or tap with two fingers.
- Click: Light.
- Scroll & Zoom:
- Deselect: Scroll direction: Natural.
Deselect the following items:
- Photos
- iCloud
- Automatically check for updates:
- Select: Install macOS updates.
- Select: Automatically download apps purchased on other Mac computers.
- Password Settings:
- Free Downloads: Save Password.
- Select: Show Bluetooth in menu bar.
- Computer's Name: [your-name].
- Make sure you're an Admin.
- Login Items:
- Remove iTunes.
- Clock:
- Date options:
- Select: Show date.
- Date options:
- General:
- Deselect all: Show these items on the desktop.
- New Finder windows show: home directory.
- Tags:
- Deselect all.
- Sidebar:
- Select all except for:
- iCloud Drive.
- Movies.
- Music.
- Pictures.
- Tags: Recent Tags.
- Select all except for:
- Advanced:
- Select: Show all filename extensions.
- Select: Keep folders on top when sorting by name.
- When performing a search: Search the Current Folder.
- Select: Devices β [your-MBP-name] in the sidebar.
- βJ:
- Select: Always open in list view.
- Select: Calculate all sizes.
- Select: Show Library Folder.
- Select: Use as defaults.
- General:
- Deselect: Open βsafeβ files after downloading.
- Advanced:
- Smart Search Field:
- Select: Show full website address.
- Select: Show Developer menu in menu bar.
- Smart Search Field:
- New Document:
- Format: Plain Text.
- Options: deselect all.
- Open and Save:
- Plain Text File Rendering:
- Opening files: Unicode (UTF-8).
- Saving files: Unicode (UTF-8).
$ xcode-select --install
$ sudo xcode-select --switch /Library/Developer/CommandLineTools # enable command line tools
For the second command, see here.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ cd
$ source brew.sh
β¦and go shopping or something π.
- In Finder, right click on a file that uses the type you'd like to change the default for.
- Select: Get Info from the context menu.
- Navigate to the Open with section and select the app from the menu.
- Select: Change Allβ¦.
- Select: Continue when/if Finder asks if you're sure.
- Dotfiles: Visual Studio Code.
- Markdown files (
.md
): MacDown. - Shell scripts (
.sh
): Visual Studio Code.
- Generating a new SSH key and adding it to the ssh-agent (make sure to do step 2 in the Adding your SSH key to the ssh-agent section).
- Adding a new SSH key to your GitHub account.
- Run this command:
$ ssh-keyscan github.com >> ~/.ssh/known_hosts
.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- Run:
source bootstrap.sh
(see: Install Dotfiles and Shell Scripts β Updating). This'll override the.bashrc
file in the home folder that the script in step 1 modified. - Run:
command -v nvm
to confirm it installed, the output should be:nvm
. - Run:
cd ~
thennvm install x
wherex
is whatever version is in the.nvmrc
file, e.g.:nvm install 9.11.1
.
brew install yarn --ignore-dependencies
yarn global add git-open
yarn global add np
If you need to manage multiple NPM tokens then add this to ~/.npmrc
(creating the file if it doesn't exist: touch ~/.npmrc
):
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
update=false
You can then set your tokens in: .extra
, e.g.:
# Store NPM tokens and set them to aliases so we can easily switch between them
alias npmme="export NPM_TOKEN=xxxx"
alias npmwork="export NPM_TOKEN=xxxx"
# Set the default
npmme
Run this command to see which account is in use:
npm whoami
- Sync settings:
- Install the Settings Sync extension.
- β + SHIFT + P β
Sync: Download Settings
β Enter GitHub Token and Gist ID (get from 1Password). - β + SHIFT + P β
Sync: Advanced Options
βSync: Toggle Auto-Upload On Settings Change
(requires window reload). - β + SHIFT + P β
Sync: Advanced Options
βSync: Toggle Show Summary Page on Upload / Download
(requires window reload).
- β + SHIFT + P β
Shell Command: Install 'code' command in PATH
.
- Choose Sync using Dropbox option then select the 1Password.oppvault file from Dropbox.
.extra
:ln -s ~/.extra ~/Dropbox/FED/Dotfiles
I couldn't put together my dotfiles and shell scripts without the awesome work of:
- Donne Martin and his dev-setup repository.
- Mathias Bynens and his dotfiles repository.
- Nicolas Gallagher and his dotfiles repository.
- Paul Irish and his dotfiles repository.
- Sourabh Bajaj and his macOS Setup Guide.
And anyone else who's been so kind to share their work out in the open.
β€οΈ open source.