This is the 14th day of my participation in the August More Text Challenge
Preface
Are you still using virtual machines? The goal of this article is to create a perfect terminal experience under Win10 through WSL2 enjoyable play Linux, goal: easy to use and comfortable eye.
Terminal
-
Search for Terminal in the Microsoft Store and get the installation:
-
The default is PoweShell, we can change the default to Ubuntu terminal in the right drop-down triangle:
Oh – my – ZSH beautification
Although the font style, size, color and theme can be changed in the Settings, but there is still a distance for our requirements to be easy to use, comfortable and pleasing to the eye. Here we install oH-my-ZSH to beautify our terminal.
-
First download the extra fonts to support special symbols, open PowerShell, and execute the following commands in sequence:
git clone https://github.com/powerline/fonts.git cd fonts .\install.ps1 Copy the code
-
Win10 Win10 Win10 Win10 Win10 Win10 Win10 Win10 Win10 Win10
Set-ExecutionPolicy RemoteSigned Agree to change input Y Copy the code
-
After installing fonts, install ZSH in Ubuntu:
sudo apt update sudo apt install git zsh -y Copy the code
-
Re-install oh-my-zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" Copy the code
-
This error is most likely due to network problems:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused Copy the code
-
Solution: Go to the site and copy the install.sh content (I have the link for you, extract code 5fs6), create a new file and paste it:
Create a new file, paste and copy the content vim 1.sh # add executable permission to execute chmod +x 1.sh ./1.sh Copy the code
-
Installation successful:
-
To install a nice ZSH theme, edit the ~/.zshrc file:
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k vim ~/.zshrc # modified ZSH_THEME = "powerlevel10k/powerlevel10k" Copy the code
-
After you restart the environment, there will be a configuration tutorial to follow.
-
Powerlevel10k/readme.md
-
Finally, modify the Settings of Windows Terminal and open the JSON file:
-
Add three lines to defaults as shown:
"defaults": { "useAcrylic": true.// Acrylic effect "acrylicOpacity": 0.6.// Transparency 0~1 "fontFace": "MesloLGS NF" / / font }, Copy the code
-
Finally, the result is as follows:
The plug-in
-
Autojump: realize quick jump between directories, want to go to which directory directly J + directory name, not in the frequent CD!!
-
When you enter the command, you can prompt auto complete (gray part). Then press the keyboard → to complete.
-
Syntax -highlighting: Everyday commands are highlighted and command errors are red.
Download the plugin. If the network is not working, you can search the project replacement address on Gitee
git clone git://github.com/joelthelion/autojump.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/autojump
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://gitee.com/mancuojie/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# execute command
cd $ZSH_CUSTOM/plugins/autojump
./install.py
Copy the code
vim ~/.zshrc
# Modify the following section
plugins=(zsh-autosuggestions
git
zsh-syntax-highlighting
autojump
)
# autojump
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
Copy the code
Finish writing already 3 o ‘clock in the morning much, liver arrives big midnight, beg a praise not too much 👍
Welcome to pay attention to the exchange 🍉🍉 any questions can be left in the comments section!
I am Mancuoj, more interesting articles: Mancuoj personal homepage – article – Nuggets (juejin. Cn)