概要
シェルをzshにしてカスタマイズをします。
macでも同じようにカスタマイズできます。
Oh My Zsh
$ zsh
と打つと
This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~). This function can help you with a few settings that should
make your use of the shell easier.
You can:
(q) Quit and do nothing. The function will be run again next time.
(0) Exit, creating the file ~/.zshrc containing just a comment.
That will prevent this function being run again.
(1) Continue to the main menu.
(2) Populate your ~/.zshrc with the configuration recommended
by the system administrator and exit (you will need to edit
the file by hand, if so desired).
--- Type one of the keys in parentheses ---
と出てくるので、0
を押してenterしてください。
Do you want to change your default shell to zsh? [Y/n]
と聞かれるのでお好みで。
Oh My Zshのインストール
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"`
Oh my Zshをインストーすしたときデフォルトのthemesはrobbyrussell
ですがお好みで変更してください。
私は学校のパソコンはclean
に設定しています。普通のターミナルとほとんど同じです。
プラグイン
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
zsh-autosuggestions
zsh-syntax-highlighting
をインストールします
プラグインの説明
`zsh-autosuggestions`:以前に実行したコマンドや履歴に基づいて、入力中のコマンドの補完候補を自動で提案してくれます。 `zsh-syntax-highlighting`:入力中のコマンドの構文を色でハイライトしてくれます.zshrc
に追記します。
.zshrc
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source ~/.zshrc
で設定を反映します。