fish(friendly interactive shell)はユーザフレンドリーなコマンドラインシェルです。
シェルをfishに切り替えてみました。

情報

環境

  • Arch Linux / fish /starship
  • Ubuntu / fish / starship
  • Windows / cmd / starship
  • Windows / powershell / starship

fish構築

  1. インストール
  • Arch Linuxの場合
    sudo pacman -S fish
  • Ubuntu (WSL)の場合
    sudo apt install fish
  1. 起動設定
  1. fishの設定

    fish_config

    [Enter]キーで終了

  2. グリーティングを無効化

    set -U fish_greeting
  3. 環境設定ファイル
    ~/.config/fish/config.fish

fishプラグイン

  • プラグイン管理 fisher
    https://github.com/jorgebucaran/fisher

    curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
  • z

    fisher install jethrokuan/z
  • fzf

    sudo pacman -S fzf
    fisher install PatrickF1/fzf.fish

    /usr/share/fish/functions/fzf_key_bindings.fish

  • fish_logo

    fisher install laughedelic/fish_logo

Starship構築

Starshipはマルチプラットフォーム対応のシェルプロンプト
https://github.com/starship/starship/blob/master/docs/ja-JP/guide/README.md

Arch

  1. Nerd Fontのインストール

    paru -S ttf-hackgen

    ターミナルソフトのフォントを``に設定する。

  2. Starshipのインストール

    sudo pacman -S starship
  3. Starshipの有効化

    ~/.config/fish/config.fish
    starship init fish | source
  4. テーマの適用

    starship preset tokyo-night -o ~/.config/starship.toml

Ubuntu

Windows

  1. font-hackgen-nerd

    管理者権限で実行
    choco install font-hackgen-nerd
  2. Starshipのインストール

    管理者権限で実行
    choco install clink-maintained
    choco install starship
  3. Starshipの有効化

  • Windows / cmdの場合
    %LocalAppData%\clink\starship.lua
    load(io.popen('starship init cmd'):read("*a"))()
  • Windows / Powershellの場合
    $PROFILE
    Invoke-Expression (&starship init powershell)
  1. テーマの適用
    starship preset tokyo-night -o ~/.config/starship.toml
.config/starship.toml

[ $os$username](bg:#a3aed2 fg:#090c0c)\

\n$character$shell"""




[username]
show_always = true
style_user = "bg:#a3aed2 fg:#090c0c"
style_root = "bg:color_orange fg:color_fg0"
format = '[ $user ]($style)'

[os]
disabled = false
style = "bg:#a3aed2 fg:#090c0c"

[os.symbols]
Windows = "󰍲"
Ubuntu = "󰕈"
SUSE = ""
Raspbian = "󰐿"
Mint = "󰣭"
Macos = "󰀵"
Manjaro = ""
Linux = "󰌽"
Gentoo = "󰣨"
Fedora = "󰣛"
Alpine = ""
Amazon = ""
Android = ""
Arch = "󰣇"
Artix = "󰣇"
EndeavourOS = ""
CentOS = ""
Debian = "󰣚"
Redhat = "󱄛"
RedHatEnterprise = "󱄛"

[shell]
fish_indicator = '󰈺 '
powershell_indicator = '_'
cmd_indicator = ' '
unknown_indicator = 'mystery shell'
style = 'cyan bold'
disabled = false