Here, I summarise how I setup my macOS for the purpose of Data Science. Ultimately, I should invest some time into automating the process.
Install HomeBrew
1
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
Turn off analytic (optional)
Install iTerm
To download different colour schemes, visit iTerm Themes

Install Go2Sehll
Download and install from Go2Shell, then configure it to work with iTerm:

Install git
1
2
3
| git config --global user.name "userName"
git config --global user.email "email@mailprovider.com"
git config --global core.excludesfile '~/.gitignore'
|
1
2
3
4
5
6
7
| mkdir ~/.ssh #if it does not already exist
chmod 700 ~/.ssh
cd ~/.ssh
ssh-keygen -t rsa -C "email@mailprovider.com"
enter a keyname
enter a passphrase
cat ~/.ssh/keyname.pub
|
Copy the key to GitHub. Go to GitHub Settings. From the left margin, choose SSH and GPG keys
and click on New SSH key
. Paste the value copied above and give the key a name.

1
2
| eval `ssh-agent -s` # if needed
ssh-add ~/.ssh/KEYNAME
|
Install zsh
1
2
3
| brew install zsh
echo "$(which zsh)"
sudo vi /etc/shells
|
Edit /etc/shells/
and add the path /usr/local/bin/zsh
at the end of the file.
Install prezto
1
| git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
|
Create soft links ln -s
to all the files found in ~/.zprezto/runcoms/
and change each link’s NAME to .NAME:
1
2
3
4
5
6
7
8
| cd ~
ln -s .zprezto/runcoms/z* .
mv zlogin .zlogin
mv zlogout .zlogout
mv zpreztorc .zpreztorc
mv zprofile .zprofile
mv zshenv .zshenv
mv zshrc .zshrc
|
Prezto has many useful modules and here is a list of all modules available. You can edit .zpreztorc
to enable any of them:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
| # Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'git' \
'archive' \
'osx' \
'python' \
'ruby' \
'fasd' \
'autosuggestions' \
'command-not-found' \
'dnf' \
'dpkg' \
'emacs' \
'gnu-utility' \
'gpg' \
'haskell' \
'helper' \
'homebrew' \
'macports' \
'node' \
'ocaml' \
'pacman' \
'perl' \
'rails' \
'rsync' \
'screen' \
'ssh' \
'tmux' \
'wakeonlan' \
'yum' \
'syntax-highlighting' \
'history-substring-search' \
'prompt'
|
Install Sublime Text
1
| brew cask install sublime-text
|
Configure Sublime Text
1
| sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
|
And then install Package Control
to enable various useful packages.

Now, using the keyboard shortcut Cmd + Shift + p
to invoke the Command Palette
.

Type Install Package
and hit enter, then type the name of the package to be installed. Visit Package Control website to search for useful packages.
Install R
1
2
3
| brew tap homebrew/science
brew install openblas
brew install r --with-openblas
|
Install RStudio (Preview version)
1
| brew install Caskroom/cask/rstudio-preview
|
Hints
Open finder from terminal
Show/hide hidden files
1
2
| defaults write com.apple.finder AppleShowAllFiles YES # to show hidden files
defaults write com.apple.finder AppleShowAllFiles NO # to hide hidden files
|
Then, press alt
while clicking on Finder icon to Relunch
Finder.