LoginSignup
10
9

More than 5 years have passed since last update.

zsh-syntax-highlightingをoh-my-zshで利用する

Posted at

zshででのコマンドプロンプトの表示をリアルタイムで色付けしてくれるzsh-syntax-highlightingを入れてみました。

以下のような表示結果になります。

スクリーンショット 2014-11-23 10.39.44.png

pathの通っているコマンドは青色、通っていないコマンドは赤で表示されます。
また(個人的にこれが一番いいのですが)クォーテーションマークで囲った文字列が色付けされます。
(わかりづらいですが、藤色でhello, worldが色付けされています)

インストール方法

私はoh-my-zshを利用しているので、それのpluginに追加する形でzsh-syntax-highlightingをインストールします。

cd ~/.oh-my-zsh/custom/plugins
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git

$HOME/.zshrcのpluginsにzsh-syntax-highlightingを追加します

plugins=(git ssh-agent ruby gem zsh-syntax-highlighting)

変更を反映させます

source ~/.zshrc

これで色がついていたら完了です!

10
9
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
10
9