fish是帥當時我買了macbook之后就幫我裝的,后來重裝了一次系統,我就自己手動裝了一次。
前提是我已經安裝好了homebrew,如果沒有安裝homebrew也可以在github上,找到fish的安裝包,或者百度一下。
1、安裝 fish
打開終端,輸入: brew install fish
brew開始執行安裝,安裝結果如下:
[LXMAJS]:issues lxmajs$ brew install fish
Updating Homebrew...
==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
alexjs chakra
==> Installing dependencies for fish: pcre2
==> Installing fish dependency: pcre2
==> Downloading https://homebrew.bintray.com/bottles/pcre2-10.32.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pcre2-10.32.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/pcre2/10.32: 224 files, 5.5MB
==> Installing fish
==> Downloading https://homebrew.bintray.com/bottles/fish-3.0.0.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring fish-3.0.0.mojave.bottle.tar.gz
==> Caveats
You will need to add:
/usr/local/bin/fish
to /etc/shells.
Then run:
chsh -s /usr/local/bin/fish
to make fish your default shell.
==> Summary
🍺 /usr/local/Cellar/fish/3.0.0: 953 files, 8.3MB
==> Caveats
==> fish
You will need to add:
/usr/local/bin/fish
to /etc/shells.
Then run:
chsh -s /usr/local/bin/fish
to make fish your default shell.
2、修改shell的配置
安裝成功后,看到如上的最后幾行提示,還需要再 shells文件中添加 /usr/local/bin/fish。
另外開啟一個終端,輸入:sudo vim /etc/shells
然后在最后空白處添加:
3、重啟shell
保存好以后,回到剛才的終端窗口,按照上面的提示輸入:chsh -s /usr/local/bin/fish
至此,fish就完成安裝和配置了。在另外開啟一個終端,會看到自動進入了fish之中。