This is the second day of my participation in the Gengwen Challenge. For more details, see “Gengwen Challenge”.
Last week, my wife gave me a Mac Book as a reward. When she got it, she was very excited to get her first Mac. But I found that I can’t use it. I can’t even install Git.
Do not understand to go to school, so search all sorts of tutorials, also installed some very useful software in the process of learning, do a summary here.
One, speed artifact
1.1 The King of shortcuts – Cheatsheet
If you want to use the Mac quickly, you need to learn how to use shortcuts. It can be a hassle to search Google for a shortcut every time you want to use it, so here’s what you found: CheatSheet, the king of shortcuts. By pressing command for 2 seconds, you can quickly call up the available shortcuts for your current app. You can also print a list of shortcut keys.
The cheatSheet interface looks like this:
Note: You may not be able to open the CheatSheet on the Mac, but that is due to permission issues. You can go to privacy and Security to allow cheatsheet.
1.2 Package management tool Homebrew
Homebrew is a package manager for MAC, similar to Apt-get for Ubuntu and yum for centos
Install BREW software:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Copy the code
Domestic image using BREW
cd "$(brew --repo)" && git remote set-url origin https://git.coding.net/homebrew/homebrew.git
cd $home && brew update
Copy the code
1.3 Items2
Website: www.iterm2.com
The Mac’s own console didn’t work, so I used this console tool.
TAB operation
- Create a new TAB: Command + T
- Close the TAB: Command + W
- Previous TAB: Command + left arrow key, Shift + Command + [
- Shitf + Command +] Shitf + Command +]
- Go to tabs 1,2,3… : Command + Label number
- Expose TAB: Option + Command + E
Panel operation
- Vertical partition: Command + D
- Split horizontally: Shift + Command + D
- Previous panel: Command + [
- The latter panel: Command +]
- Switch to the up/down/left/right panel: Option + Command + up/down left/right arrow keys
Other operating
- To Enter or exit the full-screen screen, run Command + Enter
- View the position of the cursor in the current terminal: Command + /
- Clear the screen (reset the current terminal) : Command + r
1.4 on – my – ZSH
On-my-zsh is an open source project that improves on the MAC’s built-in ZSH command.
Advantages:
- The interface is beautiful.
- Supports plug-in installation.
sh -c "$(wget -O- https://gitee.com/shmhlsy/oh-my-zsh-install.sh/raw/master/install.sh)"
Copy the code
The following message is displayed after the installation is successful:
Oh-my-zsh has many beautiful themes:
https://github.com/ohmyzsh/ohmyzsh/wiki/themes
Copy the code
The configuration is simple. Open the configuration file ~/.zhsrc and change the ZSH_THEME value to the theme name of your choice
Such as:
$ vim ~/.zshrc
# Change the subject name
ZSH_THEME="cloud"
Copy the code
Then reload the configuration file
$ source ~/.zshrc
Copy the code
1.5 AutoJump
A software that automatically enters a specified directory in the command console.
For example, now I want to go into this directory:
/Users/project/01.Github/01.PassJava/passjava-learning
Copy the code
You have to type in a lot of folders, or you have to use TAB to complete them, no matter how you type, you have to use multiple keys to do it, is there any one button to get to this directory?
That’s AutoJump. through
Installation documentation: github.com/wting/autoj…
Easy to install with Homebrew:
brew install autojump
Copy the code
Then configure the autoJump file
vim ~/.zshrc
Copy the code
Find plugins= and add autoJump after:
plugins=(git autojump)
Copy the code
Open a new line, add the command, and then save and exit.
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh
Copy the code
To make the.zshrc file effective:
source~ /.zshrcCopy the code
I configured my project as a shortcut directory:
J -a l < directory address >Copy the code
Then enter the following command each time to jump to the specified directory:
j l
Copy the code
1.6 Command correction artifact
It’s called TheFuck. When we use a command, what if we type a wrong letter or miss a dash, but want to quickly correct and re-execute?
The general approach is to check for any errors, and then re-execute the command after correcting them. Is there a faster way to auto-correct and execute?
This means “thefuck”. Although the name is not elegant, what it means is: “fuck! I’m typing wrong here again!”
The usage mode is as follows:
Teleport: github.com/nvbn/thefuc…
1.6.1 Installation Procedure
brew install the fuck
Copy the code
Then open the.zshrc file:
vim ~/.zshrc
Copy the code
Add the following command to the.zshrc file:
eval $(thefuck --alias OK)
Copy the code
The word “OK” is used in place of the word “fuck”. If you type the wrong command, retyping OK will automatically correct it.
For example, if I want to list all the files in the current folder, type the command LLL, but there is an extra L.
zsh: command not found: lll
Copy the code
Then type OK. You will be prompted if you want to type ll. Press Enter to execute the LL command. The up and down keys can also switch other commands. As shown in the figure below:
Two, writing artifact
Because I often need to write articles and take notes, I have moved the Windows writing tool to the MAC.
2.1 Typora
Take notes, write articles, the indispensable Markdown artifact.
Liverpoolfc.tv: typora. IO /
2.2 Snipaste
A screenshot software, easy to use don’t don’t. Don’t tell me you download wechat /QQ to take screenshots. 😂
Liverpoolfc.tv: zh.snipaste.com/download.ht…
2.3 uPic
UPic is used to automatically upload pictures, can configure a variety of picture bed, I use seven niuyun picture bed.
Snipaste + uPic + Typora, these three software use together, write articles, take notes, perfect.
First use snipaste screenshots, and then copy to Typora, it will automatically upload with uPic, and then upload the successful address will automatically paste to Typora.
2.3.1 installation upic
brew install upic
Copy the code
2.3.2 configuration upic
In Typora preference Settings, configure the image upload tool as uPic.
Third, development tools
3.1 the Git
Git is the code commit tool that programmers all over the world use.
Install Git through Homebrew
brew install git
Copy the code
Besides, I have a new computer, and the SSH key for my computer is not available on Github or Gitee. So I need to make a new one.
Generate the SSH key
ssh-keygen -t rsa
Copy the code
Copy the SSH key
pbcopy < ~/.ssh/id_rsa.pub
Copy the code
And added to Github and Gitee.
3.2 Java JDK
Currently, the Zulu JDK supports the M1 chip, which can be downloaded from the following website. I downloaded JDK 11 to version.
https://www.azul.com/downloads/zulu-community/?os=macos&architecture=arm-64-bit&package=jdk
Copy the code
After downloading, click Install and enter Java -version in the console
3.3 the Maven
Download maven
Links.jianshu.com/go?to=https…
Unzip it and move it to a familiar directory.
To configure MAVEN_HOME, modify the ~/.zshrc file:
vim ~/.zshrc
Copy the code
Add the configuration to the end of the file
Export MAVEN_HOME = / Users/data / 02 software/apache maven - 3.6.3 export PATH = $PATH: $MAVEN_HOME/binCopy the code
To make it effective
source ~/.zshrc
Copy the code
View the Maven version
mvn -version
Copy the code
As shown in the figure below, maven version 3.6.3 is printed
3.4 VS Code
Visual Studio Code (VS Code) is a free cross-platform source Code editor developed by Microsoft. The software supports auto-completion of syntax highlighting, code refactoring, view definitions, and has built-in command-line tools and Git version control. Users can personalize by changing themes and keyboard shortcuts, and they can extend the software by installing extensions through the built-in store. (Source: Wikipedia)
I prefer VS Code for front end development.
Liverpoolfc.tv: code.visualstudio.com/
Four, learning,
4.1 Wechat reading
I use an M1 computer, so I can download the iPhone app. This is not the case. I downloaded an ios version of wechat reading, which is very smooth and can be used for full-screen immersive reading.
Some students may say, isn’t there a web version of wechat reading? It does, but it doesn’t keep track of how long I read.
4.2 Geek Time
Install ios version, but can not log in!
Five, common necessary
Some other commonly used software I also listed here.
- Thunderbolt, much cleaner than Windows, basically no advertising.
- Baidu network disk, download can not be used, and M1 has not done compatible, light pain ah.
- Tencent conference, meeting essential.
- Focus lists, like tomato clocks.
- IDEA, Xcode I also downloaded two large development tools, IDEA behind the Spring Cloud project is sure to use. XCode is basically thinking about the Command line Tools.
- Microsoft To Do, record what it is going To Do. In addition, multiple device terminals can synchronize data with each other, which is great!
- Evernote + Web Clipping, which I usually use to back up blog content on my website, can be copied and saved to Evernote with one click.
About author: 8 years Internet workplace veteran | full stack engineer | 90 super dad | open source practitioner | public number ten thousand fan original number master. Bluebridge contract author, author of “JVM Performance Tuning In Practice” column, handwritten a set of 70,000-word SpringCloud combat summary and 30,000-word distributed algorithm summary. Welcome to follow my public number “Wukong chat structure”, free access to information to learn.