开发环境搭建

1、安装 clash-prop

ClashX.dmg

2、安装 Wrap

Warp.dmg

3、安装 brew

Copy
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

4、安装 oh-my-zsh

Copy
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

安装好之后，需要把 zsh 设置为当前用户的默认 shell（这样新建命令的时候才会使用 zsh）：

Copy
chsh -s /bin/zsh

4-1、声明高亮

使用 Homebrew 安装：

Copy
brew install zsh-syntax-highlighting

安装成功之后，令编辑～/.zshrc 文件，在最后一行增加下面配置：

Copy
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

4-2、自动补齐

配置步骤，先克隆 zsh-autosuggestions 项目，到指定目录：

Copy
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/plugins/zsh-autosuggestions

然后，编辑～/.zshrc 文件，找到 plugins 配置，增加 zsh-autosuggestions 插件：

Copy
plugins=(git zsh-autosuggestions)

5、安装 node

先用brwe search nodejs查看 node 的版本，然后选择合适的版本安装，我这是安装 node@18 版本

Copy
brew install node@18

安装最后会有提示，安装提示操作

Copy
==> Caveats
node@18 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have node@18 first in your PATH, run:
echo 'export PATH="/usr/local/opt/node@18/bin:$PATH"' >> ~/.zshrc

For compilers to find node@18 you may need to set:
export LDFLAGS="-L/usr/local/opt/node@18/lib"
export CPPFLAGS="-I/usr/local/opt/node@18/include"
==> Summary
🍺 /usr/local/Cellar/node@18/18.18.1: 2,337 files, 51.1MB
==> Running `brew cleanup node@18`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> node@18
node@18 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have node@18 first in your PATH, run:
echo 'export PATH="/usr/local/opt/node@18/bin:$PATH"' >> ~/.zshrc

For compilers to find node@18 you may need to set:
export LDFLAGS="-L/usr/local/opt/node@18/lib"
export CPPFLAGS="-I/usr/local/opt/node@18/include"

按照提示输入

Copy
echo 'export PATH="/usr/local/opt/node@18/bin:$PATH"' >> ~/.zshrc

此文由 Mix Space 同步更新至 xLog
原始链接为 https://liu-wb.com/posts/default/1