Skip to content

Instantly share code, notes, and snippets.

@coilysiren
Last active June 12, 2019 05:59
Show Gist options
  • Save coilysiren/bea156a0979df9695e9afbda095730f0 to your computer and use it in GitHub Desktop.
Save coilysiren/bea156a0979df9695e9afbda095730f0 to your computer and use it in GitHub Desktop.
personal WSL (Windows Subsystem for Linux) dev setup
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
export PATH="/home/lynn/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
zsh
# WSL support
# https://github.com/Microsoft/WSL/issues/1887#issuecomment-294297758
unsetopt BG_NICE
# https://github.com/wting/autojump
. /usr/share/autojump/autojump.sh
# https://stackoverflow.com/questions/16853624/git-discovery-across-filesystem-not-set
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
# https://github.com/creationix/nvm
export NVM_DIR="/home/lynn/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# https://github.com/robbyrussell/oh-my-zsh
export ZSH="/home/lynn/.oh-my-zsh"
ZSH_THEME=""
plugins=()
HYPHEN_INSENSITIVE="true"
DISABLE_UNTRACKED_FILES_DIRTY="true"
DEFAULT_USER=lynn
# https://github.com/zsh-users/zsh-autosuggestions
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
# https://github.com/sindresorhus/pure
fpath+=('/home/lynn/.nvm/versions/node/v11.1.0/lib/node_modules/pure-prompt/functions')
autoload -U promptinit; promptinit
prompt pure
PURE_GIT_PULL=0
# aliases
function gc {
_gc "$1" &
}
function _gc {
rm -f .gitoutput
git commit . -m "$1" --allow-empty &>> .gitoutput
git push -u origin HEAD --verbose &>> .gitoutput
[ $? -ne 0 ] && cat .gitoutput; rm -f .gitoutput
}
alias ls='ls -GFh'
alias gt='git status'
alias gush="git push -u origin HEAD"
alias git-modified="$EDITOR `git status --porcelain | sed -ne 's/^ M //p'`"
alias line-wrap-disable='tput rmam'
alias line-wrap-enable='tput smam'
# go
export GO111MODULE=on
export GOPATH=/mnt/c/Users/Lynn/projects/

A WSL Dev Guide

This readme should get you setup with a WSL (Windows Subsystem for Linux) local dev environment. The target auidence is engineers who've heard about WSL, but haven't personally felt like taking the time to set it up yet.

Things To Install

As a pre-pre-requisite, you'll want to use windows insider (eg. beta) builds if you're using wsl. wsl is edge technology, so you'll need to be on beta builds if you want to take full advantage of it. Sign up for that here => https://insider.windows.com/en-us/. Setting it up (via install => restart => install => restart) can take quite some time! Maybe do your dishes during.

After that, there's a few applications that (are better suited for / have to be installed on) windows instead of wsl. So go get those:

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