Skip to content

A guide to setting up the environment for Node.js, Python, and Java development on OS X.

Notifications You must be signed in to change notification settings

jasonyueyang/mac-dev-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mac Dev Environment Setup

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

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

Environment configuration

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.

Automation

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.

Command line developer tools

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

Homebrew

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 

Downloading packages

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 use brew install python3, it will install 3.5.0.

Homebrew cask

For GUI applications, you will want to use Homebrew-cask:

brew install caskroom/cask/brew-cask

Applications

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 like code 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

Thanks to...

About

A guide to setting up the environment for Node.js, Python, and Java development on OS X.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages