开发环境搭建

79 阅读1分钟

安装brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

并不觉得好用 todo 优势是什么?

安装iterm

iTerm2 - macOS Terminal Replacement 能装插件

zsh-syntax-highlighting

作用 平常用的lscd 等命令输入正确会绿色高亮显示,输入错误会显示其他的颜色。

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

zshrc

plugins=(git zsh-syntax-highlighting)

zsh-autosuggestions

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

todo 有那些提效插件?

安装ohmyzsh

它捆绑了数以千计的有用功能、助手、插件、主题 todo 有那些好用的插件

安装autojump

brew install autojump
plugins=(git autojump)

尝试了下 蛮好的

安装git

Git - Downloads (git-scm.com)

配置ssh

SSH 公钥设置 | Gitee 产品文档

安装mysql

MySQL :: Download MySQL Community Server (Archived Versions) 小白入门:MySQL超详细安装教程(mac版) - 知乎 (zhihu.com)

绿秒红问题(注意版本与系统版本的兼容) MAC安装MySQL - 掘金 (juejin.cn)

=》mysql下没有data文件夹

=》可能是版本问题 8.3 => 8.0.36 => 8.0.25

=》完全清除mysql

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /var/db/receipts/com.mysql.*

确定是版本问题了

zshrc

#mysql
PATH=$PATH:/usr/local/mysql/bin
#mysql end

安装navicat

Navicat Premium 16.2最新激活教程,永久使用来了(mac版) - 知乎 (zhihu.com)

安装node

Node.js (nodejs.org)

安装pnpm

npm install pnpm -g
pnpm config get registry pnpm config set registry http://registry.npm.taobao.org

配置pnpm

PNPM设置全局包的安装路径 - 掘金 (juejin.cn)

pnpm setup

安装nestjs

npm i -g @nestjs/cli
nest init my-project
pnpm i
pnpm start:dev

安装vscode

Download Visual Studio Code - Mac, Linux, Windows

code命令

mac 使用code命令打开VSCode,解决重启失效 - 掘金 (juejin.cn)

安装code:打开VSCode –> command+shift+p –> 输入shell command –> 点击提示Shell Command: Install ‘code’ command in PATH运行

命令行中code 路径能直接打开

配置vscode和插件

ESLint

GitLens

Material lcon Theme

Nest-Server-Tools

Prettier -Code formatter

=》 vscode自动格式化配置 - 掘金 (juejin.cn)

zshrc 配置


#alias

# vscode打开zsh
alias ozsh="code ~/.zshrc"
# 加载zshrc
alias s="source $ZSH/oh-my-zsh.sh"
# 简化pnpm
alias p="pnpm"
# 简化项目启动命令
alias psd='pnpm start:dev'

# pnpm
export PNPM_HOME="/Users/danjinghao/Library/pnpm"
case ":$PATH:" in
  *":$PNPM_HOME:"*) ;;
  *) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end

# autojump
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
# autojump end


#mysql
PATH=$PATH:/usr/local/mysql/bin
#mysql end