This repo summarizes how I set up the development environment for Node.js, Python, and Java development on my Mac with OS X El Capitan.
If you need to set up a similar dev environment, I hope this can be a helpful reference for you.
- System preferences
- Environment configuration
- Automation
- Command line developer tools
- Homebrew
- Downloading packages
- Homebrew cask
- Applications
- Resources
Here are some of my settings.
- General > Sidebar icon size: Small
- General > Automatically hide and show the menu bar: On
- General > Default web browser: Google Chrome.app
- Dock > Size: smaller
- Dock > Magnification: smaller
- Dock > Automatically hide and show the Dock: On
- Language & Region > Add Chinese, Simplified
- Display > Automatically adjust brightness: Off
- Energy Saver > Turn display off after: 2 min
- Keyboard > Delay Until Repeat: Short
- Keyboard > Use all F1, F2 etc. keys as standard keys: On
- Keyboard > Shortcuts > Input Sources > Select the previous input source: On
- Trackpad > Tap to click: On
- Sound > Show volume in menu bar: On
- Internet Accounts > Add your favorite accounts
As a developer, you will spend a lot of time using the command window. Customizing the command line environment will make you more efficient.
💡 If you're not familiar with shell commands, it's well worth brushing up on your CLI commands.
To save time, and to create a consistent dev environment, it is beneficial to automate the setup.
You can take a look at the .setup script as a reference. Make sure you understand what it does and customize it to tailor for your needs.
💡 For Chrome, I find it easier to install manually. Otherwise you will need to go through special steps to get the password saving feature work.
I use Homebrew, the most popular package manager for OS X, to manage installation. Homebrew has a dependency on the command line developer tools, which can be installed either by downloading Xcode, or by running the following command:
xcode-select --install
To check if it's installed properly, you can print the active developer directory:
xcode-select -p
After this, you can check for Homebrew and install it if it's not present:
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc
fi
Now you can install a package (or "formula", following the brew terminology) like this:
brew install node
I typically install these:
💡 You can check the Python version with
python -V
. The default Python from OS X is version 2.7.10. If you usebrew install python3
, it will install 3.5.0.
For GUI applications, you will want to use Homebrew-cask:
brew install caskroom/cask/brew-cask
You can use something like brew cask search visual-studio-code
to search for an app. Or you can search apps at http://caskroom.io/search.
Once this is done, you can install your favorite applications like this:
brew cask install --appdir="/Applications" visual-studio-code
Here are some of my favorite applications:
💡 To run Code directly from command line, you can install the shell command:
Cmd+Shift+P
>Shell Command: Install 'code' command in PATH
. Then you can run Code with something likecode foo.txt
.
💡 You can also create a shortcut to launch Sublime Text from command line. Then you can run Sublime with something like
sub foo.txt
.
cd ~
mkdir bin
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl ~/bin/sub
💡 If you are a VIM lover, you can turn on the VIM mode in Sublime:
Preferences > Settings-Default > Remove ”ignored_packages": ["Vintage"] (and the last trailing comma)
Preferences > Settings-User: Add "vintage_start_in_command_mode": true
💡 To enable TypeScript support in Sublime Text, install the TypeScript-Sublime-Plugin. This would look something like:
cd ~/"Library/Application Support/Sublime Text 2/Packages"
git clone --depth 1 https://github.com/Microsoft/TypeScript-Sublime-Plugin.git TypeScript
In addition, I also install these applications:
- iTunes
- OneNote
- OneDrive
- Remote Desktop for Mac
- Office for Mac (Outlook, Word, PowerPoint, Excel)
- Lync for Mac
- https://github.com/nicolashery/mac-dev-setup
- https://github.com/mathiasbynens/dotfiles
- https://github.com/thoughtbot/laptop
- Hacker's Guide to Setting up Your Mac
- Compiling a Web Development Environment on Mac OS X
- How I set up my Mac development machine
- Mac OS X Setup Guide
- Definitive Guide to Setting up a New Mac for Development
- Setting Up a New Mac for OS X Web Development
- Setting Up a Mac Dev Machine From Zero to Hero With Dotfiles