Recently, I have been using the terminal of the system, but I always want the function of command prompt and completion, so I found the tool Oh My Zsh, and the default shell of the new version of macOS is also Zsh. ITerm2 actually feels like no big difference in the terminal use of the comparison system, modify the font and color are very nice, but there are a few small optimization I did not find in the terminal. Install and configure Oh My Zsh.

Oh My Zsh official website: ohmyz.sh/

To install Homebrew, go to the official website to copy a command and execute it. However, you may encounter the problem that you cannot access when installing Homebrew before. The same solution is: FQ + set terminal agent. I won’t go into that here. Installation commands are no longer posted because they are subject to change with software updates, such as Homebrew’s installation commands.

Once installed, go to.zshrc to view:

open -e ~/.zshrc
Copy the code

To explain what this instruction means, open means open. -e: open with text editing, otherwise open with the system default program. ~ refers to the user directory and can be omitted if it is the current user directory. Here you can see that the.zshrc file has a lot more configuration, and most of it is for comments. If you want to open it with Sublime Text, write:

open -a "Sublime Text" ~/.zshrc
Copy the code

-a: Use Application, use quotation marks if the name has Spaces.

For the prompt feature, use zsh-AutoSuggestions and add zsh-syntax-highlighting. The installation method is also one line command, go directly to GitHub home page is the best, there will be installation tutorial. However, the installation tutorials for both plug-ins are not available on the GitHub home page. Instead, you need to click on install. md to see the tutorials.

After installing it, you need to configure the plugins node in the.zshrc file to make it available, plugins=(zsh-autosuggestions zsh-synthing-considering), GitHub has GitHub as the standard. There are also several themes that can be changed in.zshrc, I prefer the default.

Alternatively, if you need to quickly open a terminal in the current folder, you can use Go2Shell or a custom script or use iTerm2 to right-click on the folder and select New iTerm2 from the service… Or Alfred can do that. Go2Shell can add an icon in the access window and click on it, but I don’t want to install additional software. I also don’t like new scripts because I can’t read the code. Alfred can use workflows, which is nice. ITerm’s own right – click folder is enough for me to use, for now. Take a closer look at Alfred’s use and configuration.

A few shortcuts:

⌘ to open preferences (General general) : ⌘ +,

To enter iTerm2 preference, go to Keys > Hotkey to set to show/hide iTerm2 Hotkey to: ⌘ + ~

Clearing terminal: ⌘ + K

Now this terminal is comfortable.