bingooyong / note

1 stars 1 forks source link

从零开始搭建Mac M1开发环境 #50

Open bingooyong opened 2 years ago

bingooyong commented 2 years ago
brew install z
bingooyong commented 2 years ago

安装node

brew install node

Node.js更换国内源

临时使用

npm --registry https://registry.npm.taobao.org install express

永久使用

npm config set registry https://registry.npm.taobao.org

验证

npm config get registry

安装yarn

npm install --global yarn
bingooyong commented 2 years ago
brew install --cask dbeaver-community
bingooyong commented 2 years ago

安装JAVA

#默认命令行安装,安装位置在:$HOME/.sdkman
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

#自定义安装
export SDKMAN_DIR="/usr/local/sdkman" && curl -s "https://get.sdkman.io" | bash

#验证
sdk version
bingooyong commented 2 years ago
➜  ~ brew tap adoptopenjdk/openjdk
==> Tapping adoptopenjdk/openjdk
Cloning into '/opt/homebrew/Library/Taps/adoptopenjdk/homebrew-openjdk'...
remote: Enumerating objects: 1996, done.
remote: Counting objects: 100% (60/60), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 1996 (delta 44), reused 49 (delta 38), pack-reused 1936
Receiving objects: 100% (1996/1996), 372.27 KiB | 179.00 KiB/s, done.
Resolving deltas: 100% (1424/1424), done.
Tapped 47 casks (69 files, 521.8KB).
➜  ~ brew search adoptopenjdk
==> Casks
adoptopenjdk-jre                 adoptopenjdk12-jre               adoptopenjdk14-openj9            adoptopenjdk16-openj9-jre
adoptopenjdk-openj9              adoptopenjdk12-openj9            adoptopenjdk14-openj9-jre        adoptopenjdk8
adoptopenjdk-openj9-jre          adoptopenjdk12-openj9-jre        adoptopenjdk14-openj9-jre-large  adoptopenjdk8-jre
adoptopenjdk-openj9-jre-large    adoptopenjdk12-openj9-jre-large  adoptopenjdk14-openj9-large      adoptopenjdk8-openj9
adoptopenjdk-openj9-large        adoptopenjdk12-openj9-large      adoptopenjdk15                   adoptopenjdk8-openj9-jre
adoptopenjdk10                   adoptopenjdk13                   adoptopenjdk15-jre               adoptopenjdk8-openj9-jre-large
adoptopenjdk11                   adoptopenjdk13-jre               adoptopenjdk15-openj9            adoptopenjdk8-openj9-large
adoptopenjdk11-jre               adoptopenjdk13-openj9            adoptopenjdk15-openj9-jre        adoptopenjdk9
adoptopenjdk11-openj9            adoptopenjdk13-openj9-jre        adoptopenjdk15-openj9-jre-large  adoptopenjdk8
adoptopenjdk11-openj9-jre        adoptopenjdk13-openj9-jre-large  adoptopenjdk15-openj9-large      adoptopenjdk
adoptopenjdk11-openj9-jre-large  adoptopenjdk13-openj9-large      adoptopenjdk16
adoptopenjdk11-openj9-large      adoptopenjdk14                   adoptopenjdk16-jre
adoptopenjdk12                   adoptopenjdk14-jre               adoptopenjdk16-openj9
➜  ~ brew install --cask adoptopenjdk11
bingooyong commented 2 years ago

jenv 安装下载

brew install jenv

# 环境变量
# Shell: bash
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile

# Shell: zsh
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc
bingooyong commented 1 year ago

zsh-autosuggestions

这是一个命令自动补全插件,当你输入命令的几个字母,它会自动根据历史输入进行自动补全,然后按→,安装也很简单:

git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
vim ~/.zshrc

加入插件列表

plugins=(
  git
  zsh-autosuggestions
)

配置生效

source ~/.zshrc