Skip to content

Instantly share code, notes, and snippets.

@luizfilipe
Forked from imfing/wsl-setup.md
Created January 25, 2021 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luizfilipe/14572ef8fb7cdd6726a1564ca8fa480d to your computer and use it in GitHub Desktop.
Save luizfilipe/14572ef8fb7cdd6726a1564ca8fa480d to your computer and use it in GitHub Desktop.
WSL + ZSH + Hyper Setup

My WSL Setup

A guide to setup your WSL with Hyper and zsh

Download & Install the WSL

  • Follow the very thorough instructions here

Get a prettier terminal

  • 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

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').

Zsh Syntax Highlighting

This was a late addition but is an amazing add-on to the terminal. Follow the steps here to get it up and running.

Zsh Auto Suggestions

Another late addition but amazing as well. Just follow the Maunal instructions here.

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

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 Gulp CLI

  • Follow the Gulp docs here.

Aliases

Just to test out using aliases, I picked a few things I type a lot into the terminal that could save me some keystrokes. Add this to your .zshrc file to do the same and add anything else you see fit:

# aliases for git
alias add='git add -A'
alias status='git status'
alias push='git push -u origin master'
alias pull='git pull'
alias log='git log'

Always Update & Upgrade

Every few days it's a good idea to run sudo apt update then sudo apt upgrade to get the latest updates from Ubuntu.

Easter Eggs

A few goodies I installed recently for fun:

  • Cowsay sudo apt-get install cowsay
  • htop sudo apt-get install htop
  • Isn't via apt-get but Bash-Snippets is great
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment