Fetch Iterm
- Iterm can be used to replace the default terminal.
- Method 1: Download iterm2.com/ from the official website.
- Method 2: [multi-habitat technology control small dong] reply [5002] keyword acquisition (all the code used in this article can be obtained).
2. Set shell to ZSH
-
The system provides many shells. The default shell format is /bin/bash. Such as:
Echo $shell echo $shell
View all shell formats supported by the system
cat /etc/shells
-
The shell used in this article is /bin/zsh, which has many excellent features.
-
The configuration command is as follows:
Set the current shell to /bin/zsh format
chsh -s /bin/zsh
Exit the system and shell reprogress
exit
View the current shell format
echo $SHELL
Install Oh My Zsh plugin
-
Oh My Zsh is an open source, community-driven framework for managing Zsh.
-
Open source: github.com/ohmyzsh/ohm…
-
Download and install method 1: Choose one of the following three methods:
Sh – c (” curl – fsSLhttps://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) “sh – c” (curl – fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)” sh -c “(the curl – fsSLhttps://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) sh -” c “(wget – O – Raw.githubusercontent.com/ohmyzsh/ohm…). “Sh -c” $(fetch – o – raw.githubusercontent.com/ohmyzsh/ohm…). “
-
If the above method cannot be downloaded: the system displays inaccessible or cannot establish SSL connection (Baidu has been useless for a long time), use the following method 2 configuration.
-
Download and install Method 2: Download the ohmyzsh repository code, grant executable permission to tools/install.sh, and install it. The command is as follows:
download
Git clone github.com/ohmyzsh/ohm…
Add executable permissions
chmod +x ohmyzsh/tools/install.sh
Execute the script to install onmyzsh
ohmyzsh/tools/install.sh
Configure plug-ins
-
Many plugins are provided in the $ZSH/plugins/ directory.
ls $ZSH/plugins/
-
These plug-ins mainly provide functions such as shortcut keys.
-
The directory for each plug-in has a readmd. md file that details how to use the plug-in. Git as an example:
ls
ZSH/plugins/git/README.md -
Configure plugins: Edit the ~/.zshrc file and add the plugins you want to configure to take effect using source. For example add Git, Ruby, and Python:
vim ~/.zshrc
Write the plugins option
source ~/.zshr
5. Configure the theme
-
Ohmyzsh provides a number of themes. A full sample can be seen below: github.com/ohmyzsh/ohm…
-
As you can see above, each topic has its own format with a unique corresponding name.
-
To configure: Edit the ~/. ZSHRC file and set the ZSH_THEME to the value you want to configure. Such as:
vim ~/.zshrc
Configure the value of ZSH_THEME
source ~/.zshr
- I use: Agnoster, Jonathan, wedisagree
6. Highlight configuration commands
-
Concept: By default, system commands are shown in white. To distinguish it from the content, you can install the following plug-in, after which system commands such as PWD, ls, and so on are highlighted.
-
The open source address is github.com/zsh-users/z…
-
To make it new, move/copy the configuration directory to $ZSH_CUSTOM/plugins/, edit ~/. ZSHRC, add ZSH -syntax-highlighting in the plugins parameter, and then use source to make it new.
cp -r zsh-syntax-highlighting $ZSH_CUSTOM/plugins/ vim ~/.zshrc
Add ZSH -syntax-highlighting to your plugins
source ~/.zshrc
7. Complete configuration commands
-
Concept: For common command completion, press TAB twice. After the completion plug-in is installed, the system will automatically display the completion command.
-
The open source address is github.com/zsh-users/z…
-
To configure: first move/copy the configuration directory to $ZSH_CUSTOM/plugins/, then edit the ~/. ZSHRC file, add zsh-autosuggestions to plugins, and use source to take effect.
cp -r zsh-autosuggestions $ZSH_CUSTOM/plugins/ vim ~/.zshrc
Add zSH-autoSuggestions to your plugins
source ~/.zshrc
Configure the Iterm status bar
-
Iterm’s status bar is turned off by default and can be turned on as follows:
Perferences->Profiles->Session-> Check the Status bar enabled at the bottom
-
Configuring the status bar: The status bar provides many tabs that can be configured in the status bar. The method is as follows:
Status bar Enabled Right click Configure Status bar -> drag the desired TAB into Active Components -> If you want to change the color scheme, you can set the auto-rainbow option below
-
Adjust the position of the status bar: for example, set the status bar to display at the bottom.
Oh My Zsh uninstall
-
Run the following command to delete the configuration file:
uninstall_oh_my_zsh
-
I’m not going to do that.
X. Video teaching version
Don’t want to see, see the video version of the: www.bilibili.com/video/BV1Rf…