LoginSignup
1
3

More than 5 years have passed since last update.

MacBook Pro のセットアップ手順の記録

Last updated at Posted at 2017-08-24

Mac の初期セットアップ

Mac整備済製品で MacBook Pro (Retina, 13-inch, Early 2015) を購入した際のセットアップ手順の記録。

Finder環境設定

finder.png
デフォルトだと拡張子が表示されないので、「Finder」→「環境設定」→「詳細」で「すべてのファイル名拡張子を表示」をチェックする。
デフォルトだとフォルダもファイルと一緒くたにソートされてしまって分かりづらいので、「名前で並べ替えるときにフォルダを上部に表示」をチェックする。
デフォルトだと検索時に Mac 全体を対象としてしまい効率が悪いので、「検索実行時:」を「現在のフォルダ内を検索」に変更する。

defaults

defaults write com.apple.finder AppleShowAllFiles YES
killall Finder
defaults write com.apple.desktopservices DSDontWriteNetworkStores YES
defaults write com.apple.dock autohide -bool true

defaults コマンドを使うとコンソールから設定を変更可能らしい。

Bash

初期状態では .bash_profile および .bashrc ファイルが存在しないので新規に作成する。

cat << "_EOF_" >> ~/.bash_profile
if [ -f ~/.bashrc ] ; then
    . ~/.bashrc
fi
_EOF_
cat << "_EOF_" >> ~/.bashrc
alias ls='ls -G'
alias ll='ls -lah -G'
alias grep='grep --color'
HISTTIMEFORMAT='%F %T '
HISTSIZE=100000
HISTFILESIZE=100000
HISTIGNORE='history:pwd:ls:ls *:ll:w:top:df *'
stty -ixon
_EOF_

Homebrew

Homebrew は macOS 用パッケージ管理システム。
他に MacPorts や Fink がある。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap homebrew/versions
brew install git vagrant-completion putty

Homebrew-Cask

Homebrew-Cask は macOS アプリケーションをコンソールからインストールできる Homebrew 拡張。

brew tap caskroom/cask
brew cask install iterm2 virutalbox{,-extension-pack} google-chrome firefox slack skype atok dropbox filezilla gitkraken istat-menus vmware-fusion adobe-creative-cloud microsoft-office vagrant{,-manager} docker netbeans-php sequel-pro keycastr
open /usr/local/Caskroom/adobe-creative-cloud/latest/Creative\ Cloud\ Installer.app

mas-cli

https://github.com/mas-cli/mas
Mac App Store のアプリケーションをコマンドラインからインストールするツール。
インストールするアプリは固有番号で指定するため、いったん検索する必要がある。

brew install mas
mas install `mas search LINE | grep LINE$ | awk '{print $1}'`
mas install `mas search Xcode | grep '^[0-9]* Xcode$' | awk '{print $1}'`

iTerm2

iterm2.png
デフォルトだと記号などのマルチバイト文字列の表示が崩れるので、「Preferences」→「Profiles」→「Default」→「Text」→「Unicode」で「Treat ambiguous-width characters as double width (not recommended)」をチェックする。

echo 'set ambiwidth=double' >> ~/.vimrc

imgcat / imgls

curl -sSo /usr/local/bin/imgcat https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat && chmod +x /usr/local/bin/imgcat
curl -sSo /usr/local/bin/imgls https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgls && chmod +x /usr/local/bin/imgls

Ranger

brew install ranger
sed -i '' '/preview_images/ s/false/true/' ~/.config/ranger/rc.conf
sed -i '' '/preview_images_method/ s/w3m/iterm2/' ~/.config/ranger/rc.conf
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3