life is too short for a diary




Setup a development environment on Windows using wsl2

Tags: wsl windows

Author
Written by: Tushar Sharma
Featured image for Setup a development environment on Windows using wsl2

Most of the terminal I have used in Windows were at best lackluster. However wsl2 is a game changer which makes your Windows OS Unixy.

First download the Windows terminal form here. By default, it will open Windows Powershell.

Next we need to install Ubuntu virtual machine. Open Windows Powershell and type

> wsl --install -d Ubuntu

You might need to reboot for the changes to be updated.

You can select Ubuntu from the setting as default

Next, we'll make the terminal more usable.

First install oh-my-zsh.

$ sudo apt-get update -y
$ sudo apt-get install git zsh -y
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Install nerd font

Generate a guid using powershell

[guid]::NewGuid()

Open Command Palette -> settings.json

profiles: {
    list: [
            {
                "colorScheme": "One Half Dark",
                "font": 
                {
                    "face": "mononoki NF",
                    "size": 14
                },
                "guid": "{GUID}",
                "hidden": false,
                "name": "Ubuntu",
                "source": "Windows.Terminal.Wsl"
            }
    ]
}

Install Powerlevel10k theme

$ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k

# Add following in ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"
source ~/powerlevel10k/powerlevel10k.zsh-theme
$ zsh 

It will prompt powerlevel font setup. If not type

$ p10k configure

Edit ~/.p10k.zsh to only show current directory

# change 
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_unique
# change it to 
typeset -g POWERLEVEL9K_SHORTEN_STRATEGY=truncate_to_last

Install lunarvim from here.


comments powered by Disqus