1.Why to do that ?
Because in the eyes of a non-Microsoft developer, the environment of windows is not very friendly, but windows software is needed daily, so there are only two choices: vm or wsl. I personally think wsl is more convenient, so I will use wsl first this time.
The following are my target requirements:
- 1.Work and life are all in one system.
- 2.File/software isolation does not affect each other.
- 3.Complete development activities in wsl.
- 4.No installation development software in the real system.
The document of Microsoft
- 1.Bios: Actvate the bios virtualization function.
- 2.Start WSL Service: input
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartin the powershell(admin mode).
- 3.Start VM Service: input
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartin the powershell(admin mode).
- 4.Download Update: Download a package that update the kernel of linux.
- 5.Reboot: Reboot your Windows.
- 6.Install Update: Install the fiveth step that downloaded package.
- 7.WSL2: use
wsl --set-default-version 2to open the second version.
You can use
wsl --list --online to find some distribution of linux and below is the release version I got through the command.
wsl --install --distribution Ubuntu/Debian/Ubuntu-20.04 to install the linux in your system and watting for the username and password to be entered when the installation is over.
wsl --list -v to watch your system
ubuntu2004.exe config --default-user <your username> to change the default user logined.
As you have more and more software, wsl will become larger and larger, because wsl is installed in the C drive directory by default, so the external operating system will be more difficult to use. So you need to move the wsl system to a separate disk.
move the wsl
- 1.Shutdown: Close your wsl terminal and use
wsl --shutdownto shutdown wsl service.
- 2.Export: use
wsl --export Ubuntu/Debian/Ubuntu-20.04 D:\\wsl.tarto export your wsl system.
- 3.Unregister: use
wsl --unregister Ubuntu/Debian/Ubuntu-20.04to destory the system that in the wsl service.
- 4.Import: use
wsl --import Debian/Ubuntu/Ubuntu-20.04 E:\\wsl D:\\wsl.tarto install system to the location you want.
You have a wsl2 linux system now.
3.A terminal software
- 1.install tabby and set the
default profile for new tabsequals
4.Oh my zsh
Use tabby to open a new terminal tab and the following operations are all done in this tab.
- 1.Install zsh
sudo apt-get install zsh -y.
- 2.Change the defualt env to zsh
chsh -s /bin/zsh.
- 3.Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- 4.Download font files and install it.
- 5.Set the tabby terminal software’s defualt font
- 7.Close and reopen tabby terminal and complete the configuration according to the terminal prompt.
- 1.Here are some plugins. if you want to install them.
- 2.You can clone thme to
- 3.Configgure the plugins name in
apt softwares was so old so i use homebrew to install softwares.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" in your terminal and follow the output logs to install that. there has some commands to use homebrew:
- 1.brew list: list all softwares your installed.
- 2.brew search name: search software.
- 3.brew install name: install software.
6.1 Visual Studio Code
Now you can download the vscode to connect the wsl to develop.
If you want to use vim/neovim then you can input
brew install neovim
- 1.Install python2,python3 and get pip2/pip3
pip2 install neovim --user
pip3 install neovim --user
mkdir ~/.config/nvim -p
touch ~/.config/nvim/init.vim -p
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimto install vim-plug
mkdir ~/.config/nvim/vim-plug -p
Add the following to ~/.config/nvim/vim-plug/plugins.vim
You can see a plugin named NERDTree between in the
plug#end,So you can also config any plugin at here.
source $HOME/.config/nvim/vim-plug/plugins.vim to reload your env.
nvim to start neovim editor and input
:PlugInstall to install your plugins.
:q! to exit neovim eidtor and reopen it with
:NERDTree to show the filetree plugin.
My neovim profile
I am learning vim from scratch, and I am only at an introductory level now. As I deepen my learning, follow-up vim articles will be published in the editor series. The configuration file will also be updated at any time, let us work hard together~