1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ターミナル編

Last updated at Posted at 2025-07-14

概要

シェルを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

で設定を反映します。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?