TECH Insights

Viden og indsigter fra IT Minds' it-talenter

VS Code and WSL => Godmode

Skrevet af Mindster og Software Developer hos IT Minds on 04-07-19 11:00
Mindster og Software Developer hos IT Minds

Going from Linux to Windows is not easy. When it came to work, nothing could beat the power of the command line and my legendary homemade vim config.


Why Windows?

I recently bought a Dell XPS 15. Really nice computer. However it seems that Dell has implemented some nice features, which to my knowledge only works on a Windows distribution. Sucks when I spent so much time mastering the vim+zsf.

The Linux subsystem for Windows brought light to my weary bones though, and I will teach you how you can harness the true power of Windows (Which is a Linux VM).

To harness the power of the Linux gods you will have to finish these three tasks;

  1. Activate The Linux subsystem for Windows.
  2. Install a Linux distro from the Windows store (I use ubuntu).
  3. Install the WSL extension for VS Code.


Activate the Linux subsystem

This is done by searching for "Turn Windows features on or off" and checking the Linux subsystem option. 

 
.


Install the Linux

Simple; get it, run it, love it.
.


Notes on the Linux distro

This will come with git preinstalled, but I have compiled a set of nice-to-have features which you can copy paste to your WSL terminal to get to the godlike level of Linux terminal control.

  • Oh my ZSH link
    Screenshot 2019-07-04 at 10.52.46
  • Node version manager link
    Screenshot 2019-07-04 at 10.52.52
    NOTE: if you installed oh my zsh first, it will add the NVM to the path.
  • Yarn package manager link
    Screenshot 2019-07-04 at 10.52.59
    We will use the --no-install-recommends since we use NVM as our node host. Otherwise delete the flag.
  • Node and NPM link
    Screenshot 2019-07-04 at 10.53.05

Wan't to see the code-snippet? Read the blogpost on Dev.to here.


The Visual Studio code part

Now this is where the magic happens, in VS Code install the plugin WSL
.

Now simple ctrl-shift-p and search WSL and click open VS Code in WSL.

VS Code will then start a server in WSL but let you use the VS Code you have installed on windows.

If you open a terminal in the new VS Code window it will open in the Linux bash, and you are now free to keep bash or install zsh and be a Linux god on Windows.

This should cover all the basic of getting to use WSL in Windows.
If you like WSL in Windows with VS code, leave a comment below or show some love!

Insights fra de bedste softwaretalenter

En del af IT Minds’ DNA er, at vi spotter og tiltrækker de bedste softwaretalenter, som er stærke i de nyeste teknologier og frameworks. Derfor vil vi gerne dele ud af vores viden og erfaringer vores konsulenter opsamler, når de afprøver og arbejder med nye teknologier og frameworks.

Seneste indlæg