合作夥伴中,看到有人把shell從bash換成fish。覺得驚豔的是會自動引導後面該打甚麼,如果確定是引導的指示,直接按下方向鍵的向右鍵就可以直接完成了。
安裝方式
Ubuntu
# apt-add-repository ppa:fish-shell/release-3
# apt-get update
# apt-get install fish
Debian
# wget -nv https://download.opensuse.org/repositories/shells:fish:release:3/Debian_9.0/Release.key -O Release.key
# apt-key add - < Release.key
# echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/3/Debian_9.0/ /' > /etc/apt/sources.list.d/shells:fish:release:3.list
# apt-get update
# apt-get install fish
Centos
# yum-config-manager --add-repo https://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish:release:2.repo
# yum install fish
apt-add-repository
是 Ubuntu 預設會裝的功能。要裝的軟體若不在官方軟體清單內的話,會需要透過來加入。
啟用方式
# chsh -s /usr/bin/fish username
把username換成自己登入的帳號
這玩具還可以安裝佈景主題~~安裝一個 Oh-my-fish(omf)後就可以安裝了
# curl -L https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
Oh-my-fish(omf)基本用法
- omf update [omf] […] //更新
- omf install [|] //安装
- omf repositories [list|add|remove] //管理安裝的包的倉庫
- omf list //顯示安装的包
- omf theme //設定主題,可以查看這https://github.com/oh-my-fish/oh-my-fish/blob/master/docs/Themes.md
- omf remove //移除
- omf reload // 重新載入 omf
- omf new pkg | theme //自定義自己的包或主題
- omf search -t|–theme / -p|–package //搜索主題或包
- omf channel
- omf doctor //檢查健康狀態
- omf destroy //刪除
- $OMF_CONFIG //全大寫英文字,別漏了$。他會帶去設定目錄
選定主題
與github列表中看到第一個theme是agnoster主題,就選這個吧
安裝主題
# omf install agnoster
# omf theme agnoster