All Projects → lloydstubber → My Wsl Setup

lloydstubber / My Wsl Setup

Quick rundown on my current setup on the Windows Subsystem for Linux.

Projects that are alternatives of or similar to My Wsl Setup

proton wsl2
Proton Kernel for the Windows Subsystem for Linux 2 (WSL 2). Highly experimental and always at the mercy of Windows Update.
Stars: ✭ 23 (-92.28%)
Mutual labels:  wsl
ubuntu-win-bootstrap
DEPRECIATED! Use "linux-comfy-chair" instead. A very simple bootstrap script to install some development tools to the Windows 10 Ubuntu Bash system - Ruby, Perl, Python, Node, Sublime Text and more!
Stars: ✭ 27 (-90.94%)
Mutual labels:  wsl
Weasel Pageant
Deprecated: An ssh-agent compatible helper for interacting with Pageant from processes running on the Windows Subsystem for Linux.
Stars: ✭ 256 (-14.09%)
Mutual labels:  wsl
nix-config
NixOS configuration (also on WSL)
Stars: ✭ 51 (-82.89%)
Mutual labels:  wsl
wsl-agent-bridge
WSL compatibility bridge for ssh-agent on Windows
Stars: ✭ 17 (-94.3%)
Mutual labels:  wsl
wsl2exe
[TESTING]Use command in WSL from exe executable
Stars: ✭ 34 (-88.59%)
Mutual labels:  wsl
webi-installers
Primary and community-submitted packages for webinstall.dev
Stars: ✭ 421 (+41.28%)
Mutual labels:  wsl
Awesome Wsl
Awesome list dedicated to Windows Subsystem for Linux
Stars: ✭ 3,544 (+1089.26%)
Mutual labels:  wsl
WSL-Distro-Rootfs
Install anyrootfs as a WSL Instance (for Windows 10 FCU 64bit or later) [WSL-DistroLauncher](https://github.com/yuk7/WSL-DistroLauncher)
Stars: ✭ 22 (-92.62%)
Mutual labels:  wsl
gitwrap
Windows Wrapper for Linux git executable
Stars: ✭ 77 (-74.16%)
Mutual labels:  wsl
uniterm
🚧Universal Terminal Emulator, might be a great toy terminal front-end for geeks.
Stars: ✭ 22 (-92.62%)
Mutual labels:  wsl
WSL-Context-Menu-Manager
Manages the context menu for your Linux tools in WSL/WSL2 for Windows.
Stars: ✭ 25 (-91.61%)
Mutual labels:  wsl
dotfiles
Dotfiles & Developer Environment. Supports Ubuntu2004+, macOS Catalina+, Windows 10 w WSL
Stars: ✭ 30 (-89.93%)
Mutual labels:  wsl
RHWSL
Red hat UBI as a WSL Instance. Supports multiple install.
Stars: ✭ 91 (-69.46%)
Mutual labels:  wsl
Vimplus
🚀An automatic configuration program for vim
Stars: ✭ 3,372 (+1031.54%)
Mutual labels:  wsl
dotfiles
Bootstrap your Ubuntu in a single command!
Stars: ✭ 85 (-71.48%)
Mutual labels:  wsl
nvim-ghost.nvim
👻 GhostText plugin for Neovim with zero dependencies 🎉 Supports neovim running inside WSL too! 🥳 Windows/Linux/macOS supported out-of-the-box! 😄 (Other OSes need python3.6+ installed)
Stars: ✭ 32 (-89.26%)
Mutual labels:  wsl
Wsl Ssh Agent
Helper to interface with Windows ssh-agent.exe service from Windows Subsystem for Linux (WSL)
Stars: ✭ 298 (+0%)
Mutual labels:  wsl
Fedora Remix For Wsl
Fedora Remix for Windows Subsystem for Linux.
Stars: ✭ 284 (-4.7%)
Mutual labels:  wsl
bash-zsh-on-windows-cmder
Integration of Bash, ZSH on Windows with Cmder
Stars: ✭ 37 (-87.58%)
Mutual labels:  wsl

My WSL Setup for Development

Quick rundown on my current setup Windows Subsystem for Linux.

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 so feel free to submit any changes.

Here’s a breakdown of how I got up and running below:

Shell Screenshot

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

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 NVM

So you have the ability to switch between Node/npm versions easily, this is the best tool out there for the WSL. I've tried a few and have come back to this.

  • Run this to install:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
  • This will then have installed the PATH into your ~/.bashrc so pop the below into the bottom of your ~/.zshrc and restart your terminal:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
  • Now with a nvm -v the command should work and you can install whatever version you'd like with nvm install 8.12.0.

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'

Change default editor

Out of the box the default editor is nano and no syntax highlighting can make it pretty tough to navigate through. So I've decided to switch the default editor to Vim:

# Set default editor to vim
export VISUAL=vim
export EDITOR="$VISUAL"

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.

Shopify Themekit

I've recently been getting into Shopify and ran into a bit of a snag when using their ThemeKit via the WSL. After creating a theme or downloading an existing one, then trying to run theme open to view changes. This command tries to open a browser with xdg-open - which doesn't work. What you'll need to do is create a shell script to get around this. Seeing as I didn't know how to create one prior to this, I'll add the details below:

  • First, navigate to usr/local/bin as we'll need the script in here so it can be executed.
  • Second, we'll need writing access, so write sudo vi xdg-open to create the file.
  • Third, paste this into the file then save and exit:
#!/bin/sh
# shell script for shopify theme kit/xdg-open to open browser. 
# replace firefox.exe with the browser of your choice.
cmd.exe /c start firefox.exe $1
  • Fourth, you'll need to make the file executable. So write sudo chmod +x xdg-open and then you're good to go! Just head back to your directory and run theme open to test.

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.
  • A lot of Hyper plugins don't work with Windows so make sure to check before installing them.
  • If you're having trouble with Ruby and it's sudo/gem issues, look at Ruby Version Manager as an alternative.

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].