LoginSignup
2

More than 5 years have passed since last update.

モダンなfishシェルをMacOSにインストールする

Last updated at Posted at 2017-11-07
  1. fishをインストール
  2. oh-my-fishをインストール
  3. デフォルトシェルにしましょう
  4. themaをインストールします
  5. 番外編(rbenv)

まずは、brewでfishをインストールします。

1. fishをインストール

$ brew install fish
$ fish -v
fish, version 2.6.0

2. oh-my-fishをインストール

omfコマンドが利用できることを確認する

$ curl -L https://get.oh-my.fish | fish
・・・(省略)
Installation successful!
Welcome to fish, the friendly interactive shell
$ omf -v
Oh My Fish version 5

:ballot_box_with_check: fishのコンフィグファイルは以下のパス
~/.config/fish/config.fish

3. デフォルトシェルにしましょう

$ which fish
$ chsh -s /usr/local/bin/fish
Changing shell for gulliver.
Password for gulliver:{#password}

もし、以下のようなメッセージが出た場合は

chsh: /usr/local/bin/fish: non-standard shell

注意: chshしてchsh: /usr/local/bin/fish: non-standard shellと怒られる場合は
vimなどで/etc/shellsを開いてファイル末尾に/usr/local/bin/fishを追記するとよい
また、readonlyになっているのでsudoを忘れずに

$ vi /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/fish

4. themaをインストールします

好きなテーマをここから探します
https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md#available-themes

お気に入りはこれ

$ omf install cyan

番外編(rbenv)

fishでrbenvを利用する場合は以下を実行するとよい

$ omf install rbenv

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
2