自宅に新しいMacBookがきたので、とりあえず使い始めるために最低限インストールしたりやったことのメモです。

前半(GUIアプリ系)

chrome

色々拡張機能入れてるし、プラグイン同期とかも簡単なのでこれ。
https://www.google.co.jp/chrome/browser/desktop/

boostnote

とにかくメモ用。Markdown使える&日本製ということで。
https://b00st.io/

alfred

ランチャーアプリ。便利なのでPowerpack(Mega Supporter)買いました。
でもポンドだから日本円にすると結構高くてびっくりする。1ドル=114円のときに1ポンド=141円だった。
https://www.alfredapp.com/

alfred wordkflow

WiFi on/off/restartに。社内のエンジニアさんが作ってる。便利。
https://github.com/ravelll/wifi-workflow\

Githubのリポジトリにアクセスできるやつ
https://github.com/gharlan/alfred-github-workflow

enpass

パスワードマネージャー。UIが良い&同期しやすい、バックアップ簡単という点でkeepassからの乗り換えです。
https://www.enpass.io/

Franz

TweetdeckとSlackとGmailの一元管理に。
http://meetfranz.com/

MacVim-Kaoriya

テキストエディターはこれだけ。
https://github.com/splhack/macvim-kaoriya/releases/tag/20170111

iTerm2

Macでターミナル使うなら。
https://www.iterm2.com/

Docker for Mac

基本的な検証はDockerだけで済ます。
https://docs.docker.com/docker-for-mac/

Karabiner

キーリピートを変更するために。
https://pqrs.org/osx/karabiner/index.html.ja

shiftlt

画面分割&整理に。
https://github.com/fikovnik/ShiftIt

後半(ターミナル環境用)

brewのインストール

Macでいろいろなコマンドやらなんやらを入れるために。
[code lang=”bash”]
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
[/code]

tmuxのインストール

sshのセッション管理、画面分割に。
[code lang=”bash”]
$ brew install tmux
[/code]

tpmのインストール

tmuxのプラグインを管理するために。
[code lang=”bash”]
$ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
$ tmux source ~/.tmux.conf
[/code]

reattach-to-user-namespace

tmuxとMacのクリップボードを共有するために。
[code lang=”bash”]
$ brew install reattach-to-user-namespace
[/code]

pecoのインストール

pecoを使ってhistoryの検索を快適に。
[code lang=”bash”]
$ brew install peco
[/code]

hubのインストール

コマンドラインでGithubを操作するように。
[code lang=”bash”]
$ brew install hub
[/code]

ghqのインストール

Gitリポジトリをpecoで操作するように。
[code lang=”bash”]
$ brew install ghq
[/code]

direnvのインストール

iterm起動したら.envファイルを読み込むように。
[code lang=”bash”]
$ brew install direnv
[/code]

envchainのインストール

環境差異を変えられるように。
[code lang=”bash”]
$ brew install envchain
[/code]

neobundleのインストール

vim用のパッケージ管理に。
[code lang=”bash”]
$ mkdir -p ~/.vim/bundle
$ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
$ vim
:NeoBundleInstall
※最初にインストールするか聞かれるかも。
[/code]

rbenvのインストール

[code lang=”bash”]
$ brew install rbenv
[/code]

pyenvのインストール

[code lang=”bash”]
$ brew install pyenv
[/code]

zshのインストール

快適なシェル環境に。
[code lang=”bash”]
$ brew install zsh
$ brew install zsh-completions
$ sudo vim /etc/shells
/usr/local/bin/zsh を追加
$ chsh -s /usr/local/bin/zsh
[/code]

dotfiles

自分で使っているdotfilesを導入するために。
[code lang=”bash”]
$ git clone https://github.com/kzm0211/dotfiles
$ bash install.sh
[/code]

Preztoのインストール

zshをより快適に。
[code lang=”bash”]
$ git clone –recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
$ setopt EXTENDED_GLOB \
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do \
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" \
done
[/code]

Rictyのインストール

見やすいフォントに。
[code lang=”bash”]
$ brew install automake
$ brew install pkg-config
$ brew tap sanemat/font
$ brew install Caskroom/cask/xquartz
$ brew install ricty
$ cp -f /usr/local/Cellar/ricty/4.1.0_2/share/fonts/Ricty* ~/Library/Fonts/
$ fc-cache -vf
[/code]

powerline用のフォントをインストール

自分の好きなzshのテーマに。
[code lang=”bash”]
$ git clone https://github.com/powerline/fonts
$ cd fonts
$ bash install.sh
[/code]

powerline用のパッチをあてる

Rictyが文字化けするのを対応するのに。
[code lang=”bash”]
$ brew install fontforge
$ git clone https://github.com/Lokaltog/powerline-fontpatcher
$ fontforge -lang=py -script ./powerline-fontpatcher/scripts/powerline-fontpatcher /usr/local/Cellar/ricty/4.0.1/share/fonts/Ricty-Regular.ttf
$ cp Ricty* ~/Library/Fonts
[/code]

powerlineのテーマを修正する

powerlineをそのまま使うと重い&パス部分が長いので。
[code lang=”bash”]
$ cd ~/.zprezto/modules/prompt/external/
$ cp -p prompt_powerline_setup prompt_inamuu-original_setup
$ mv prompt_powerline_setup prompt_inamuu-original_setup
$ vim prompt_inamuu-original_setup
[/code]

下記修正。
[code lang=”bash”]
# 追加
function curdir {
basename $(pwd)
}

# 修正
POWERLINE_LEFT_A="%K{red}%F{white} "$(curdir)" %k%f%F{red}%K{blue}"$POWERLINE_SEPARATOR
POWERLINE_LEFT_B="%k%f%F{white}%K{blue} "’${vcs_info_msg_0_}’" %k%f%F{blue}"$POWERLINE_SEPARATOR"%f "
PROMPT=$POWERLINE_LEFT_A$POWERLINE_LEFT_B
[/code]

[code lang=”bash”]
$ cd ../functions/
$ ln -s prompt_inamuu-original_setup ../external/inamuu-original/prompt_inamuu-original_setup
$ vim ~/.zpreztorc
zstyle ‘:prezto:module:prompt’ theme ‘inamuu-original’
$ zsh -l
[/code]

うーむ、長かった。あとは追々。
こうゆうのまとめていると、社内の人たちが使っている便利アプリとか各種ソフトウェアのプラグインがまとまっているWikiとかあったらいいなぁとふと思うのです。
人数が多いと変態があらわれて収拾がつかなくなりそうですが笑

カテゴリー: Mac