Make writing a habit together! This is my first day to participate in the “Gold Digging Day New Plan · April More text challenge”, click to see the details of the activity.

Recently, I bought a MAC and made a note of how I configured my own “weighing hand” development environment in case someone else needed it.

MAC installation brew

Installeer Homebrew

The following does not require scientific Internet access can be installed, during the need to enter two boot password.

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

ITerm2 gorgeous terminal

To make the terminal fancy and easy enough to use, iTerm2 is recommended with a little configuration that combines appearance and efficiency. And through the vim ~/.zshrc configuration file, configure and integrate more plug-ins and functions, the following configuration of several commonly used plug-ins, so you can advance

Make plugins=(git zsh-autosuggestion autojump zsh-synthing-highlighting) in.zshrc and install and guide it.

Oh – My – Zsh configuration

Oh My Zsh is a community-driven command line tool based on the Zsh command line, providing theme configuration, plugin mechanism, and greatly improved playability. Increased efficiency can also make people happy HHH

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, themes, and a few things that make you shout

The installation

/ / lot, Need science online sh -c "$(curl - fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" / / domestic mirror, Without science online sh -c "$(curl - fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh)"Copy the code

The default theme is pretty good, if you want to change the theme vim ~/.zshrc to ZSH_THEME configuration, this thing can also set their fancy background image, and coding activity, etc., interested friends fine taste.

zsh-syntax-highlightingSyntax highlighting

Great for kids who are not familiar with Linux commands, it will highlight the correct commands!

Install: Brew install ZSH -syntax-highlighting

Use: Be sure to set. ZSHRC according to the output during installation

Configuration: Based on the above print, type the configuration in.zshrc and apply the configuration from the command line source ~/.zshrc

autojumpconfiguration

Once you use it, you can hop across the file system over and over again without having to go CD, CD, CD

Realize the quick jump between directories, want to go to which directory j + directory name directly (even do not need to enter the full), do not need to frequent the CD

Brew install autojump

Use: Be sure to set. ZSHRC according to the output during installation

zsh-autosuggestions Input advice

Instead of having to type a full word each time, the plugin provides input suggestions and completions.

Installation:

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

Volta – Manage node versions

Volta is a hassle-free way to manage your JavaScript command-line tools.

curl https://get.volta.sh | bash // install node volta install node // pin command allows you to choose your Node engine Volta pin [email protected] // Check the node version node -v NPM -vCopy the code

SSH Key Settings – Configure multiple accounts

The email addresses of your company and your personal are different. You need to generate SSH keys to identify the account when you use Git.

Generate the SSH Key

personal

sh-keygen -t rsa -C "[email protected]"

Press Enter and enter the SSH Key information. Individuals are named ID_rsa_personal

The company

sh-keygen -t rsa -C "[company]@qq.com"

Press Enter and enter the SSH Key information. The individual name is ID_rsa_company

The generated public and private key files may be in the same directory as.ssh, so drag them into the.ssh directory as follows:

Use SSH Key

Add. Pub content to Github to gain access to Github.

Duplicate Key

If Github is a private account, run pbcopy < ~/. SSH /id_rsa_personal.pub to copy the contents of id_rsa_personal.

Set the Key

Log in to GitHub and go to Settings->SSH and GPG keys>New SSH Key to add it

The company account is basically the same as the previous one. Copy pbCopy < ~/.ssh/id_rsa_company.pub to add the personal Key and company Key to the corresponding client after they are generated locally. Let’s use the config file to differentiate and test.

Test the Key

CD ~/. SSH: Go to the. SSH file

Touch config: Create a config file

Vim config: Modifies the config file

If both individuals and companies use Github, you can set it as follows:

# personal
Host personal.github.com
HostName github.com
User Jin
IdentityFile ~/.ssh/id_rsa_personal

# company
Host company.github.com
HostName github.com
User Jin
IdentityFile ~/.ssh/id_rsa_company
Copy the code

If the individual is using Github and others, the Settings are as follows:

# personal Host github.com HostName github.com User Jin IdentityFile ~/.ssh/id_rsa_personal # company Host bitbucket.org User Jin IdentityFile ~/.ssh/id_rsa_companyCopy the code

Add a Key to the local SSH Agent

ssh-add -K ~/.ssh/id_rsa_personal

ssh-add -K ~/.ssh/id_rsa_company
Copy the code

Perform tests:

Github SSH -t [email protected] SSH -t [email protected] // other SSH -t [email protected] SSH -t [email protected]Copy the code

If the connection is successful, a message will be displayed:

Vscode plug-ins are commonly used

javascript console utils

Shortcuts generate console.log directly, no need to manually type, debug a good tool

JavaScript (ES6) code snippets

Es6 code block, syntax tips

vscode-icons

Recognition files generate ICONS that are easy to identify, making it easier to find files

GitLens

Enhance Git functionality, visual operation of Git in vscode, you can see each line of code related to Git history, creator, etc

Finally, there are other useful tools and plug-ins, welcome to leave a message ~ (my front end)