My laptop setup
After setting myself up on four laptops in the space of two years, I figured it was time to write this all down. Mike Gelbart’s setup has been useful to me, so maybe mine will be useful to you.
macOS preferences
- Enable tap to click.
System Preferences
→Trackpad
- Check
Tap to click
- Set mouse speed to maximum.
System Preferences
→Trackpad
- Set
Tracking Speed
toFast
- Enable 3-finger drag.
System Preferences
→Trackpad
→Accessibility
→Mouse & Trackpad
→Trackpad Options
- Check
Enable dragging
withthree finger drag
- Configure hot corners.
System Preferences
→Trackpad
→Hot Corners
- Top left:
Desktop
- Top right:
Mission Control
- Bottom left:
Put Display to Sleep
- Bottom right:
Launchpad
- Turn on Night Shift.
System Preferences
→Displays
→Night Shift
- Set schedule to
Sunset to Sunrise
Installations
- developer tools:
xcode-select --install
- 1Password
- Chrome
- Dropbox
- Quicksilver
- iTerm2
- Homebrew
- R
- RStudio
- Anaconda
- Typora
- Visual Studio Code
- Spotify
iTerm2 configurations
- Set the default typing style to Natural:
Preferences
→Profiles
→Keys
- Set
Load preset
toNatural Text Editing
- Set new windows/tabs to open from previous session’s directory:
Preferences
→Profiles
→General
- Under
Working Directory
, checkReuse previous session's directory
Bash aliases
Put the following in .bash_profile
:
alias tp="open -a typora"
alias rst="open -a rstudio"
alias vs="open -a 'visual studio code'"
alias prev="open -a preview"
SSH
ssh-add -K ~/.ssh/id_rsa
to store passphrase in Keychain.
Then add the following to ~/.ssh/config
:
Host *
UseKeychain yes
AddKeysToAgent yes
IdentityFile ~/.ssh/id_rsa
Git
Configure my user.
git config --global user.name "David Laing"
git config --global user.email davidkendalllaing@gmail.com
Create a global gitignore file.
touch ~/.gitignore_global
Put this in it:
.DS_Store
.ipynb_checkpoints
.Trashes
.RHistory
.RData
__pycache__
Set up git aliases.
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
Set up tab completion for git branches.
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
Add this to .bash_profile
:
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
Run chmod -X ~/.git-completion.bash
, and restart iTerm2.
RStudio configurations
Change the default RStudio pane layout.
Preferences
→Pane Layout
- Top left:
Source
- Top right:
Console
- Bottom left:
History
- Bottom right: everything else
Add a margin line.
Preferences
→Code
→Display
- Check
Show margin
Remove the default to save .RData
.
Preferences
→General
- Uncheck
Restore .RData into workspace at startup
- Change
Save workspace to .RData on exit
toNever
Set up keyboard shortcuts.
Preferences
→Code
→Editing
→Modify Keyboard Shortcuts
- Open Previous Tab:
Alt+Cmd+Left
- Open Next Tab:
Alt+Cmd+Right
- Move focus to source:
Cmd+1
- Move focus to console:
Cmd+2
- Move focus to terminal:
Cmd+3
Create custom snippets.
Preferences
→Code
→Edit Snippets
- Add these:
snippet pview
{View(.); .}
snippet pprint
{print(.); .}
Jekyll
Install rbenv
(So you don’t have to alter the version of Ruby that comes with Mac.)
# Install rbenv and ruby-build
brew install rbenv
# Setup rbenv integration to your shell
rbenv init
# Check your install
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
# Install a new version of Ruby
rbenv install 2.5.3
rbenv global 2.5.3
ruby -v
Install Jekyll
This post was useful, as was this issue comment.
gem install bundler
bundle install
To build a site:
bundle exec jekyll build
To test it locally:
bundle exec jekyll serve