Last active
July 10, 2022 09:30
-
-
Save peter-wangxu/2e2e0c1fe08107d0d3efe4ddcd609528 to your computer and use it in GitHub Desktop.
config my new mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 参考文档:https://medium.com/%E6%95%B8%E6%93%9A%E4%B8%8D%E6%AD%A2-not-only-data/macos-%E7%9A%84-terminal-%E5%A4%A7%E6%94%B9%E9%80%A0-iterms-oh-my-zsh-%E5%85%A8%E6%94%BB%E7%95%A5-77d5aae87b10 | |
# 安装brew | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
brew install zsh | |
brew install git | |
brew install iterm2 | |
brew install maven | |
brew install golang | |
# 安装oh-my-zsh | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# 下载套件至 Zsh 的 plugin 里 | |
$ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions | |
# 启用套件(在 ~/.zshrc 里) | |
plugins=(zsh-autosuggestions) | |
# 下载套件 | |
$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting | |
#命令行自动提示 | |
brew install navi | |
# 使用 brew 安裝 | |
$ brew install autojump | |
# 把设置加入 .zshrc | |
[ -f $(brew --prefix)/etc/profile.d/autojump.sh ] && . $(brew --prefix)/etc/profile.d/autojump.sh | |
# 重新读取zshrc | |
$ source ~/.zshrc | |
# 启用套件 | |
plugins=(git zsh-autosuggestions zsh-syntax-highlighting autojump) | |
# 禁用brew update --auto-update | |
echo "export HOMEBREW_NO_AUTO_UPDATE= false" >> ~/.zshrc | |
# 配置 GOPROXY 环境变量 | |
echo "export GOPROXY=https://proxy.golang.com.cn,direct" >> ~/.zshrc | |
# 还可以设置不走proxy的私有仓库或组,多个用逗号相隔(可选) | |
echo "export GOPRIVATE=code.alipay.com,gitlab.alibaba-inc.com" >> ~/.zshrc | |
go install github.com/cweill/gotests/gotests@latest | |
go install github.com/fatih/gomodifytags@latest | |
go install github.com/josharian/impl@latest | |
go install github.com/haya14busa/goplay/cmd/goplay@latest | |
go install github.com/go-delve/delve/cmd/dlv@latest | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
go install golang.org/x/tools/gopls@latest | |
# comfig vim | |
brew install vim | |
mv ~/.vimrc ~/myvimrc.bak | |
wget -O ~/.vimrc https://raw.githubusercontent.com/peter-wangxu/vim-configuration/master/.vimrc_default | |
echo "Will install vim plugins via Vundle for current user:" | |
mkdir -p ~/.vim/bundle | |
rm -rf ~/.vim/bundle/Vundle.vim | |
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim | |
echo "Begin to install VIM plugins:" | |
vim +PluginInstall +qall | |
# install vim-go dependencies | |
vim +GoInstallBinaries | |
# install ctags for vim-go | |
brew install ctags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment