fish + starship
fish(friendly interactive shell)はユーザフレンドリーなコマンドラインシェルです。
シェルをfishに切り替えてみました。
情報
環境
- Arch Linux / fish /starship
- Ubuntu / fish / starship
- Windows / cmd / starship
- Windows / powershell / starship
fish構築
- インストール
- Arch Linuxの場合
sudo pacman -S fish
- Ubuntu (WSL)の場合
sudo apt install fish
- 起動設定
- Arch Linux, Ubuntuの場合
fish をインタラクティブシェルとして設定する~/.bashrc if [[ $(ps --no-header --pid=$PPID --format=comm) != "fish" && -z ${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=''
exec fish $LOGIN_OPTION
fi
fishの設定
fish_config
[Enter]キーで終了
グリーティングを無効化
set -U fish_greeting
環境設定ファイル
~/.config/fish/config.fish
fishプラグイン
プラグイン管理 fisher
https://github.com/jorgebucaran/fishercurl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
-
fisher install jethrokuan/z
-
sudo pacman -S fzf
fisher install PatrickF1/fzf.fish/usr/share/fish/functions/fzf_key_bindings.fish
-
fisher install laughedelic/fish_logo
Starship構築
Starshipはマルチプラットフォーム対応のシェルプロンプト
https://github.com/starship/starship/blob/master/docs/ja-JP/guide/README.md
Arch
Nerd Fontのインストール
paru -S ttf-hackgen
ターミナルソフトのフォントを``に設定する。
Starshipのインストール
sudo pacman -S starship
Starshipの有効化
~/.config/fish/config.fish starship init fish | source
テーマの適用
starship preset tokyo-night -o ~/.config/starship.toml
Ubuntu
Windows
font-hackgen-nerd
管理者権限で実行 choco install font-hackgen-nerd
Starshipのインストール
管理者権限で実行 choco install clink-maintained
choco install starshipStarshipの有効化
- Windows / cmdの場合
%LocalAppData%\clink\starship.lua load(io.popen('starship init cmd'):read("*a"))()
- Windows / Powershellの場合
$PROFILE Invoke-Expression (&starship init powershell)
- テーマの適用
starship preset tokyo-night -o ~/.config/starship.toml
|
Comment