directory
- Homebrew is installed
- Making configuration
- ZSH configuration
- Macvim configuration
- The Java configuration
Homebrew configuration
Since gist is not accessible, so use this blogger’s configuration Homebrew domestic how to install automatically (domestic address). However, pay attention to the network stability, it is best to be able to connect to the physical network cable, otherwise it may be interrupted, but I am not sure, maybe the Wi-Fi router is too garbage
Making configuration
Use the tutorials on the website
#git config
git config --global user.name yourname
git config --global user.eamil [email protected]
Generate an SSH key
ssh-keygen -t rsa -b 4096 -C "[email protected]"
# to create config
touch ~/.ssh/config
Edit config and add the following code
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
# Start SSH proxy
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/id_rsa
Test whether the connection is successful
ssh -T [email protected]
Copy the code
ZSH configuration
Mac OS now uses ZSH by default, so just configure oh-my-zsh, referring to chi’s ultimate Shell
ZSHRC, because the environment variables will be configured in Homebrew, don't lose it
cp ~/.zshrc ~/.zshrc_backup
# Download oh-my-zsh instead of using automatic installation because wGET is not installed on MAC by default
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
# My Robby Shell theme configuration
Copy the code
Macvim configuration
Install macvim
brew install macvim
Configuration vimrc
Vimrc address
Vimrc theme
onedark
tip
You can configure the corresponding file type by creating ~/.vim/ftplugin/***. Vim. For example, you can add a ~/.vim/ftplugin/dart.vim file and add the following content
set tabstop=2
set shiftwidth=2
Copy the code
Dart files can be indented to 2 Spaces without affecting other types of files such as.java
The Java configuration
Brew Cask install Java installs the latest version by default. You can also use adoptopenJDK to download the corresponding version
Switch version
Enter the ls/Library/Java/JavaVirtualMachines/look at the installed version then. Corresponding JAVA_HOME ZSHRC file Settings
/usr/libexec/java_home this is an official MAC configuration tool
exportJAVA_8_HOME = $(/ usr/libexec/java_home - 1.8 v)export JAVA_14_HOME=$(/usr/libexec/java_home -v14)
export JAVA_HOME=$JAVA_8_HOME
alias jdk14="export JAVA_HOME=$JAVA_14_HOME"
alias jdk8="export JAVA_HOME=$JAVA_8_HOME"
Copy the code
other
# installation FZF
brew install fzf
# Bind shortcut keys
$(brew --prefix)/opt/fzf/install
Copy the code