DEV Community

Lloyd Stubber
Lloyd Stubber

Posted on

My WSL Setup for Development

After a few headaches with running the Git Bash on Windows I’ve decided to move over the WSL for all development purposes. I’m very new to Linux so this is a very top-level overview of what I've done and some notes on issues I ran into.

If you have anything to ad, please comment below or feel free to create a PR for the repo here.

Enjoy!

Download & Install the WSL

  • Follow the very thorough instructions here

Get your terminal looking pretty pt.1

  • Download Hyper.js here
  • I went with the 'hyperblue' theme

Automatically open in Bash

  • Open up Hyper and type Ctrl + ,
  • Scroll down to shell and change it to C:\\Windows\\System32\\bash.exe

Install Zsh

  • Run this sudo apt-get install zsh
  • Open your bash profile nano ~/.bashrc
  • Add this to set it to use ZSH as default:
if [ -t 1 ]; then
exec zsh
fi
Enter fullscreen mode Exit fullscreen mode

Get your terminal looking pretty pt.2

  • Install Oh My Zsh with sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  • Read docs here on how to add more plugins and change themes (I went with their out of the box 'robbyrussell').

Fix the ls and cd colours

  • Out of the box when you ls or cd + Tab you get some nasty background colours on the directories. To fix this, crack open your ~/.zshrc file and add this to the end:
#Change ls colours
LS_COLORS="ow=01;36;40" && export LS_COLORS

#make cd use the ls colours
zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}"
autoload -Uz compinit
compinit
Enter fullscreen mode Exit fullscreen mode

Install Git

  • Run this sudo apt update
  • Then run sudo apt install git

Setup a SSH key and link to your Github

  • Follow the Linux steps here to create a key and add it to your SSH agent
  • Then type cat ~/.ssh/id_rsa.pub
  • Copy your key from the terminal and paste it into your Github keys

Install Node Version Manager

  • Follow the instructions here which will get you running on Node/npm and can easily roll-back versions to suit.

Install Gulp CLI

  • Follow the Gulp docs here.

Notes

  • I had trouble with Node/npm/Gulp before realising Ubuntu won’t automatically upgrade from 14.04 to 16.04 - as mentioned in this article. If you’re in the same boat, upgrade via these instructions.
  • I also had trouble with older versions of Windows 10 not liking Gulp via the WSL - inotify and socket issues. Make sure you're running on the Creators Update or Insiders Program versions.
  • If your shell is running slow (mine was) switch from nvm to n and install it with their curl command. First make sure to uninstall nvm and get rid of any trace of Nodejs/npm. If n doesn't work as a command on zsh, it would have installed it's path into your ~/.bashrc so just copy it over to your ~/.zshrc.

Top comments (0)