0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macのターミナルを変えた話

Last updated at Posted at 2020-05-17

参考

自分がやったことのメモ

ターミナルのテーマ

"Iceberg"を導入した。
というかすでに導入してたっぽい。

シェルをbashからzshへ変更

macにデフォルトで入っている /bin/zsh ではなく、
ひとまず、最新を導入した。

(1) zshをインストール

$ brew update
$ brew install zsh

(2) /etc/shells にzshのパス /usr/local/bin/zsh を追加。

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
# 追加
/usr/local/bin/zsh

(3) ログインシェルを変更

$ chsh -s /usr/local/bin/zsh

プロンプトを変更

(1) 以下のコマンド2つを実行

$ 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

(2) zstyle ':prezto:module:prompt' theme 'sorin'theme の箇所を pure にします。
:prezto:module:prompt という文字列をエディタで検索して、 Prompt の設定場所を探してください。

~/.zpreztorc
#
# Prompt
#

# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
zstyle ':prezto:module:prompt' theme 'pure'

(3) 'syntax-highlighting' \'autosuggestions' \'prompt' \ の上に記載する

# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
  'environment' \
  'terminal' \
  'editor' \
  'history' \
  'directory' \
  'spectrum' \
  'utility' \
  'completion' \
  'syntax-highlighting' \
  'autosuggestions' \
  'prompt' \

nodeを入れている場合

環境パスを通す

nodeが使えるように環境パスを通す。

echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile

zshを初めて使う場合に、nodeのバスが通っていないので、npmとか使えなくなるので通します。

echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.zprofile
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?