Skip to content

Instantly share code, notes, and snippets.

@rlscode
Forked from leodutra/-setup-windows-wsl-devenv.md
Created January 26, 2021 03:48
Show Gist options
  • Select an option

  • Save rlscode/460cb851c45d9da88c9d4ccca832f38f to your computer and use it in GitHub Desktop.

Select an option

Save rlscode/460cb851c45d9da88c9d4ccca832f38f to your computer and use it in GitHub Desktop.
Installing Windows Subsystem for Linux 2, Hyper, ZSH and VSCode extensions

Installing Windows Subsystem for Linux 2, Hyper, ZSH, Node.js and VSCode extensions

Requirements

  • Windows 10 Build 18917+ (only as Windows Insider 09/2019)

Steps

1. Enable WSL2

Run in PowerShell, as admin (elevated):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

2. Install a Linux distro for WSL2

  • open Microsoft Store on Windows
  • search for Linux
  • install Ubuntu 18.04 (recommended)

3. Install Chocolatey

Run in CMD, as admin:

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

4. Install Hyper and VSCode using Chocolatey

Run in CMD, as admin:

choco install hyper vscode -y

5. Set Hyper to use WSL

  • open Hyper;
  • Edit > Preferences
  • change lines:
    shell: 'C:\\Windows\\System32\\wsl.exe',
    shellArgs: [],
  • save preferences;
  • restart Hyper.

6. Install ZSH and Oh My Zsh

Run in Hyper:

sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

7. Install NVM using ZSH

Run in Hyper:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash
echo "export NVM_DIR=~/.nvm\n[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> ~/.zshrc
source ~/.zshrc

8. Install Node (latest) using NVM

Run in Hyper:

nvm install node
nvm alias default node

9. Install Yarn

Run in Hyper:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install --no-install-recommends yarn

10. Install Nodemon, PM2, ESLint, Pug

Run in Hyper:

npm i -g nodemon pm2 eslint pug

11. Install neofetch

Run in Hyper:

nvm install neofetch
echo 'neofetch' >> ~/.zshrc

12. Install VSCode extensions

Run in Hyper:

code --install-extension amandeepmittal.pug
code --install-extension bierner.markdown-preview-github-styles
code --install-extension DavidAnson.vscode-markdownlint
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension formulahendry.code-runner
code --install-extension hollowtree.vue-snippets
code --install-extension jianbingfang.dupchecker
code --install-extension ms-vscode.cpptools
code --install-extension ms-vscode.csharp
code --install-extension ms-vscode.vscode-typescript-tslint-plugin
code --install-extension msjsdiag.debugger-for-chrome
code --install-extension naumovs.color-highlight
code --install-extension octref.vetur
code --install-extension pkief.material-icon-theme
code --install-extension ritwickdey.LiveServer
code --install-extension rust-lang.rust
code --install-extension sysoev.language-stylus
code --install-extension WallabyJs.quokka-vscode
code --install-extension yzane.markdown-pdf
code --install-extension yzhang.markdown-all-in-one

13. Upgrade Ubuntu

sudo apt upgrade -y

14. Exit Hyper

Run in Hyper:

exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment