LoginSignup
2
2

More than 3 years have passed since last update.

iTerm2 ことはじめ for fish

Last updated at Posted at 2019-11-26

まっさらな iTerm2 があります。

最初に iTerm2 の設定をしましょう。

Preferences->General->Window とすすみ Adjust window when changing font size をオフにします。
Preferences->Profiles->General の Working Directory で Reuse previous session's directory にします。

つぎに brew をいれます。 それ経由で fish いれます。

$ brew install fish
$ chsh -s /usr/local/bin/fish

したいのですが、non-standard などのエラーがでるので、 /etc/shells/usr/local/bin/fish を追記してから chsh をうちます。

これで、シェルの変更まで出来ました。

次に色を変えます。

$ fish_config

でテーマを選んだり。

iTerm の設定から、color を import したりしましょう。

背景は 232323 で color preset は Tomorrow Night を選びがちです。

その次は prompt を変えましょう。これも fish_config でいけます。ほんとうに :fish: って便利です。

ぼくは好みにの形があるので、以下のように書いておきます。

.config/fish/functions/fish_prompt.fish
function fish_prompt
    set prompt (set_color green)(prompt_pwd)
    set git (set_color blue)(__fish_git_prompt)
    set symbol (set_color normal)"\$ "
    echo -n $prompt
    echo $git
    echo $symbol
end

このあとは、fisher を入れてそれ経由で z をいれます。

$ curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
$ fisher add jethrokuan/z

z 便利すぎます。

fzf をいれます。

$ brew install fzf
$ fisher add jethrokuan/fzf

つぎにターミナル立ち上げ時に表示される

Last login: Tue Nov 26 19:15:44 on ttys001
Welcome to fish, the friendly interactive shell

を消します。

$ touch .hushlogin
$ set fish_greeting

あとは fish Awesome なやつを眺めてカスタマイズしてみてください。
https://github.com/jorgebucaran/awesome-fish

:fish: :fish: :fish: :beer: thanks!

2
2
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
2
2