OSX Survival Guide

Bootstrap #

strap is the successor of boxen created by the current homebrew maintainer Mike McQuaid.

Download the Script #

curl >

Configuration #

Edit the script, e.g. using vim, uncomment and fill up the following environment variables:


The customized can be automatically generated at, which asks for your authorization on GitHub. But I prefer to edit the script manually.

strap is idempotent, so you can run it first, adding custom dotfiles and brewfile repositories later, then run it again.

Run #


Keyboard #

In System Preference > Keyboard > Modifier Keys, Control and Command keys can be swapped. However, under the terminal I'd like to use the classical ctrl prefixed shortcuts, thus I swapped them back again. iTerm2 is a terminal emulator with this option.

I also installed AltTab to switch applications with alt-tab.

Mouse #

Unselect "Scroll direction: Natural" in System Preferences > Mouse. (The direction may be natural to touch screen, but it is not natural for mouse at all.)

Trackpad #

Select "Tap to click" in System Preferences > Trackpad.

Lock Screen #

Press Control+Shift+Power to turn off and lock screen. Alternatively, you can put the Screen Lock icon on touch bar (System Preference > Keyboard > Touch Bar) or configures hot corners.

Turn off Internal Display #

When the power adapter is connected:

  1. Close the lid to put laptop to sleep.
  2. Reactivate laptop via external input devices, e.g. keyboard.

Tiling #

Long press the restore button, then select tiling in drop-down menu.

Another way is activating mission control. Then move one window to another full screen window in another virtual desktop.

Drag the edge between two tiling windows to adjust the size of the two windows at the same time.

Virtual Desktops #

Press Ctrl-Left/Right to switch among virtual desktops.

Press Ctrl-Up/Down to show an overview of desktops or go back to normal mode.

Finder #

By default, ~/Library is hidden. To reveal it in Finder temporarily, hold the Option key, then click the Go menu, and the Library folder is revealed in the dropdown menu.

To permanently reveal the Library folder in Finder, run the following command:

chflags nohidden ~/Library/

BTW, most applications' user configuration files are in ~/Library/Application Support.

Safari #

To enable developer tools, select "Show Develop menu in menu bar" in Safari > Preferences > Advanced. You can also change the default encoding to UTF-8.

There are several vi shortcuts extensions for safari, for example, sVim.

sVim can be configured via sVimrc via the extension settings in Safari. I mapped d and D to close and undo close tab:

" Shortcuts

map "d" quit
map "shift+d" lastClosedTab

Google #

Google accounts can be added to the Except for the gmail, other osx applications can also sync with Google account:

Chinese Input Method #

I use the built-in Double Pinyin Input Method. The built-in input method uses Caps to switch between English and Chinese mode, which makes sense to me. I also use Caps to switch between English and Chinese mode under Linux (the trick is to clear lock and bind Caps to another unused key, e.g. Multi_key, then configure it as the switch key in fcitx).