NewMac

This passage is to record what I must install and config on a totally new mac.

FYI

Mac OS X Setup Guide

Tools to Install

Note: I will only cover those that need to download from a certain area. By default, you can search on Google or Baidu to the official page to download.

The Unarchiver

download via App Store

Xcode

download via App Store

Chinese Input Method

Sogou or something else.

iWork Suite

Including Keynote, Pages, Numbers

download via App Store

Microsoft Suite

Including Word, Powerpoint, Excel, OneNote, Skype, OneDrive and Outlook if you like.

Need to hack if you do not want to buy them.

FYI http://www.jianshu.com/p/4db35a5afd92

Note: It would be appreciated to download the official version and avoid using a hacked one.

WeChat

download via App Store

QQ

Just from im.qq.com

iTerm2

Just download from official home page

Tips:

  • 命令行标记功能: 这个功能简单来说就是,我们在某一行按下 Cmd + Shift + M 将这行标记下来。随后我们在需要的时候,可以按下 Cmd + Shift + J 就可以立即跳回这一行了。

Alfred3

Need to hack if you do not want to buy them.

http://www.sdifenzhou.com/alfred321.html

Note: It would be appreciated to download the official version and avoid using a hacked one.

Youdao Dic

download form official home page

SourceTree

download form official home page

ShadowsocksX

You must know I am not likely to give you the visible link hhhh~

Config

Screenshot Location

1
2
3
4
5
6
# create a folder
$ cd ~/Desktop
$ defaults write com.apple.screencapture location ~/Desktop/screenshots

# change it!
$ defaults write com.apple.screencapture location ~/Desktop/screenshots

control to scale

1
accessibility -> scale -> using decorative keys to scale

3 fingers to drag

1
system preferences -> accessibility -> trackpad options -> enable drag -> 3 fingers

Develop Tools

Ruby

Change Ruby Source

1
2
3
4
5
6
7
$ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
$ gem sources -l
*** CURRENT SOURCES ***

https://gems.ruby-china.org
# 请确保只有 gems.ruby-china.org
$ gem install rails

Brew

Install Brew

1
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Need to enter your password here.

Then, you’d better run brew install wget

Oh My Zsh

Install iTerm first.

git and curl or wget needed.

Install Oh My Zsh

1
2
3
4
5
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

or

$ sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Customization

Plugins and themes.

More details here

More

Enable word jumps

By default, word jumps (option + → or ←) do not work. To enable these, go to “iTerm -> Preferences -> Profiles -> Keys”. Press the + sign under the list of key mappings and add the following sequences:

Option + right

1
2
3
⌥→
Send Escape Sequence
f

Option + left

1
2
3
⌥←
Send Escape Sequence
b

Highlight

First, $ brew install zsh-syntax-highlighting

Then, in ~/.zshrc file

1
2
# make zsh-syntax-highlighting enabled
$ source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

You’d better restart iTerm.

Git

Install

1
$ brew install git

Version

1
$ git --version

Config Globaly

1
2
$ git config --global user.name "xxx"
$ git config --global user.email "xxx@xx.com

You can just call git config --global credential.helper osxkeychain to avoid inputing password every time pushing repositories.

Global Ignore

$ vi ~/.gitignore

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Folder view configuration files
.DS_Store
Desktop.ini

# Thumbnail cache files
._*
Thumbs.db

# Files that might appear on external disks
.Spotlight-V100
.Trashes

# Compiled Python files
*.pyc

# Compiled C++ files
*.out

# Application specific files
venv
node_modules
.sass-cache

SSH Config for GitHub

More

check existing

$ ls -al ~/.ssh

generating new SSH key

$ ssh-keygen -t rsa -b 4096 -C "xx@xx.com"

Graph painted.

start ssh-agent

$ eval "$(ssh-agent -s)"

add the key to ssh-agent

$ ssh-add -K ~/.ssh/id_rsa

copy pub key

$ pbcopy < ~/.ssh/id_rsa.pub

config on GitHub

Omited.

Vim

FYI

Cocoapods

1
2
$ brew update
$ brew install cocoapods

Node.js

Install Node

1
2
$ brew update
$ brew install node

Install Node.js with nvm (Node Version Manager)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# install nvm
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash # if zsh installed, replace bash with zsh

# install node.js
$ nvm install node

# version check and switch
$ nvm ls
$ nvm use node
$ nvm ls-remote
$ vnm alias default node

# install packages using npm
$ npm install <package> # Install locally
$ npm install -g <package> # Install globally

Java

Check it first using java -version. If not installed, download sdk from Oracle.

After install the jdk

Add export JAVA_HOME=$(/usr/libexec/java_home) # this is the toppest java version found by system automaticallyto the ~/.zshrc or ~/.bash_profile

1
2
3
4
5
6

$ source ~/.zshrc # or ~/.bash_profile if zsh not installed
$ echo $JAVA_HOME

# to check whether it points to the target folder like
/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home

More

Hexo

So easy by $ npm install -g hexo-cli

文章目录
  1. 1. Tools to Install
    1. 1.1. The Unarchiver
    2. 1.2. Xcode
    3. 1.3. Chinese Input Method
    4. 1.4. iWork Suite
    5. 1.5. Microsoft Suite
    6. 1.6. WeChat
    7. 1.7. QQ
    8. 1.8. iTerm2
    9. 1.9. Alfred3
    10. 1.10. Youdao Dic
    11. 1.11. SourceTree
    12. 1.12. ShadowsocksX
  2. 2. Config
    1. 2.1. Screenshot Location
    2. 2.2. control to scale
    3. 2.3. 3 fingers to drag
  3. 3. Develop Tools
    1. 3.1. Ruby
      1. 3.1.1. Change Ruby Source
    2. 3.2. Brew
      1. 3.2.1. Install Brew
    3. 3.3. Oh My Zsh
      1. 3.3.1. Install Oh My Zsh
      2. 3.3.2. Customization
        1. 3.3.2.1. Enable word jumps
        2. 3.3.2.2. Highlight
    4. 3.4. Git
      1. 3.4.1. Install
      2. 3.4.2. Version
      3. 3.4.3. Config Globaly
      4. 3.4.4. Global Ignore
      5. 3.4.5. SSH Config for GitHub
        1. 3.4.5.1. check existing
        2. 3.4.5.2. generating new SSH key
        3. 3.4.5.3. start ssh-agent
        4. 3.4.5.4. add the key to ssh-agent
        5. 3.4.5.5. copy pub key
        6. 3.4.5.6. config on GitHub
    5. 3.5. Vim
    6. 3.6. Cocoapods
    7. 3.7. Node.js
      1. 3.7.1. Install Node
      2. 3.7.2. Install Node.js with nvm (Node Version Manager)
    8. 3.8. Java
    9. 3.9. Hexo
,