Preface:
The request of his teammates, to write this blog
WSL is a subsystem in Windows, compared to Ubuntu, no visual interface, but the speed is relatively faster than Ubuntu run on a virtual machine, the function is not so complete.
Preparation Tool:
- Computer system Windows 10
- Fonts (font at WSL is the ugly, there will be garbled phenomenon after the installation of some of zsh)
Configuration of the system
Open the Control Panel -> Programs -> Enable or disable Windows features -> find Windows for Linux subsystems checked, restart the computer.
Open the Microsoft Store to download Ubuntu subsystem, I downloaded 18.04STL
Open, after installing the update source
- Enter the command to change the sources.list file, of course, need super powers, so to add sudo;
sudo vim /etc/apt/sources.list
- Add an entry in the file front;
key input i insert mode, the copied into this code
after use the Esc, input:wq!
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
- After editing, save the file, and then run the following command.
sudo apt-get update
sudo apt-get upgrade
Installation oh-my-zsh
- Install zsh
sudo apt-get install zsh
Set the default shell to zsh
chsh -s $(which zsh)
After setting using the following command to check whether the setting is successful
echo $SHELL
- Installation oh-my-zsh
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
- Set agnoster Theme
open oh-my-zsh configuration file
sudo vim ~/.zshrc
Modify the color theme for the agnoster
ZSH_THEME="agnoster"
Save and exit, reload the configuration file under
source ~/.zshrc
- Configuration is highlighted
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
Reconfigure
source ~/.zshrc
Open vim configuration file
vim ~/.vimrc
Add the following
colorscheme ron
:syntax on
filetype on
filetype plugin on
filetype indent on
set sts=4
set shiftwidth=4
set backspace=2
set tabstop=4
set showmode
set nu
set nohlsearch
This basic configuration has been completed, but the terminal interface will exist garbled
Solution, change the font
[font download link] [link to download font]
[font download link]: https://github.com/powerline/fonts
Packaged download, there is a compressed package after download, install each ttf file in the file after decompression.