WSL環境であればbrewを入れること
Ubuntuであれば
sudo apt install build-essential procps curl file git
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew instaill fish
まずはbrewが使えるようにPATHを通しておく
mkdir -p ~/.config/fish
cat <<'EOF' > ~/.config/fish/config.fish
set -x HOMEBREW_PREFIX /home/linuxbrew/.linuxbrew
set -x HOMEBREW_CELLAR /home/linuxbrew/.linuxbrew/Cellar
set -x HOMEBREW_REPOSITORY /home/linuxbrew/.linuxbrew/Homebrew
set -x PATH /home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin $PATH
set -x MANPATH /home/linuxbrew/.linuxbrew/share/man $MANPATH
set -x INFOPATH /home/linuxbrew/.linuxbrew/share/info $INFOPATH
EOF
fishに切り替えて再起動する
which fish | sudo tee -a /etc/shells
chsh -s /home/linuxbrew/.linuxbrew/bin/fish
StarshipはNERDフォントが必要なのでインストールしてターミナルに設定しておく
フォントはHackGenが良さげ
brew install starship
してからの
echo 'starship init fish | source' >> ~/.config/fish/config.fish
再起動する
見た目をよりカスタマイズしたければドキュメントを
NERDfontを探すツールを使うと便利
https://www.nerdfonts.com/cheat-sheet
自分の現状はこんな感じ
# Use custom format
format = """
$username[@](bold black)$hostname$directory$git_branch$git_commit$git_state$git_metrics $git_status $time
[](bold cyan)[ ](bold purple)"""
[username]
disabled = false
format = "[שּ $user]($style)"
show_always = true
style_root = "white bold"
style_user = "white bold"
[hostname]
disabled = false
format = "[$hostname]($style) in "
ssh_only = false
style = "white"
trim_at = "."
[directory]
style = "cyan"
[git_branch]
format = "[$symbol$branch]($style)"
[git_state]
style = "yellow"
[git_status]
ahead = ""
behind = ""
conflicted = "×"
deleted = ""
diverged = "ﮙ "
format = "[$stashed](cyan)[$conflicted$deleted](red)[$renamed$modified](yellow)[$staged](blue)[$untracked](purple)"
modified = " "
renamed = " "
staged = " "
stashed = ""
untracked = "●"
up_to_date = " "
[time]
disabled = false
format = "[ $time]($style)"
style = "bold yellow"
このままではコマンド履歴をインクリメンタルサーチできなかったりするのでプラグインを追加する
プラグインマネージャにはfisher(https://github.com/jorgebucaran/fisher)を使う
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher
fisher update
インクリメンタルサーチをできるようにする
https://github.com/jethrokuan/fzf
brew install fzf
fisher install jethrokuan/fzf
ローカルブランチの絞り込み
fisher install tsub/fish-fzf-git-recent-branch