用mac一年多了,一直使用zsh,不过最近一直感觉用iterm2打开新标签奇卡无比,排查一番之后发现是nvm的郭,注释掉掉~/.zshrc中的nvm环境变量设置后 速度要快很多,但是每次都要忍受这样的速度实在受不了。我的解决颁发是默认使用fish,需要用到node的时候切换到zsh
因为fish的默认配置非常好用了,开箱即用
安装
brew install fish
#使用
从zsh 切换到fish
➜ wwwroot fish
Welcome use awen mac
❰wenjun❙~/Documents/wwwroot❱✔≻
永久切换
chsh -s /usr/local/bin/fish
如果上面的命令不成功,确保/etc/shells
有fish的路径
➜ wwwroot cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/fish
默认清空下,不需要任何配置,fish就已经很好用了
配置
输入 fish_config
可以进行终端配置
踩坑: mac下提示无权限在~/.cache目录下创建文件或目录,赋予其权限即可
然后会打开下面的页面进行设置
设置完毕后,在终端输入stop 退出后重新打开终端即可
❰wenjun❙~❱✔≻ fish_config
Web config started at 'file:///Users/wenjun/.cache/fish/web_config-1GXVGY.html'. Hit enter to stop.
stop
Shutting down.
更多用法参考官网https://fishshell.com/