LoginSignup
14
7

More than 5 years have passed since last update.

zsh & preztoのインストール (macOS)

Last updated at Posted at 2018-04-14

Macの新規環境を作る時にいつもハマるのでまとめ
preztoはzshの環境構築フレームワークです。

Homebrewインストール

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

とりあえずbrewコマンドを使えるようにHomebrewをインストール。

zsh

zshインストール

brew install zsh zsh-completions

zsh起動

zsh

prezto

preztoソースコードをclone

git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"

preztoインストール

setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
  ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done

初期起動シェルをzshに

chsh -s /usr/local/bin/zsh

Command + N でターミナルを再起動して、新しいシェルが出たらインストール成功です。

テーマ変更

初期テーマだと物足りないのでpowerlineって人気のテーマに変更

vi ~/.zpreztorc

zstyle ':prezto:module:prompt' theme 'sorin'

zstyle ':prezto:module:prompt' theme 'powerline'

フォント追加

標準フォントではないフォントを使っているので文字化けしないようフォントをインストール

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts

終わったらターミナルの設定変更でPowerlineって接尾詞がついたフォントを選んでターミナルを立ち上げ直したら終わり。

14
7
1

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
14
7