Skip to content

Instantly share code, notes, and snippets.

@AndrewThian
Last active August 30, 2018 09:58
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 AndrewThian/f152163ff61e384a9356e24331e02efd to your computer and use it in GitHub Desktop.
Save AndrewThian/f152163ff61e384a9356e24331e02efd to your computer and use it in GitHub Desktop.

Hyper config

Installing hyper-material-theme. Just follow these instructions.

Set Hyper to use WSL's Bash by default

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

WSL (.bashrc) config stuff

Add these stuff to your .bashrc

  • Removing the horrendous ls color scheme
# Change ls colours
LS_COLORS="ow=01;36;40" && export LS_COLORS

Installing Zsh

Its quite straight forward to install zsh:

  1. sudo apt update
  2. sudo apt install zsh

Default launching of zsh(if you want):

if [ -t 1 ]; then
exec zsh
fi

gotcha if you accidentally enable zsh without a .zshrc you'll end up in a cyclic zsh terminal load. use chsh to change shell you dumb ass. Refer here

Set up an alias for your dev folder on your windows mount:

alias dev="cd /mnt/c/Users/{Username}/Desktop/dev" 

Install oh-my-zsh

oh-my-zsh has great plugin management which is why i like it. Install via:

# using wget
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
# or via curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Installing Pure Theme(zsh shell)

Pure. Requires git and node for automatic installation.

My manual installation script:

wget https://raw.githubusercontent.com/sindresorhus/pure/master/async.zsh -P ~/.oh-my-zsh/custom/themes
wget https://raw.githubusercontent.com/sindresorhus/pure/master/pure.zsh -P ~/.oh-my-zsh/custom/themes

# sudo if needed
ln -s "$PWD/pure.zsh" /usr/local/share/zsh/site-functions/prompt_pure_setup
ln -s "$PWD/async" /usr/local/share/zsh/site-functions/async

Add the following configuration AFTER sourcing for $ZSH/oh-my-zsh.sh in your .zshrc profile remember to remove the ZSH_THEME=""

# initialize Pure theme
autoload -U promptinit; promptinit

# optionally define some options
PURE_CMD_MAX_EXEC_TIME=10

prompt pure

Presto! Restart Hyper.js

Installing nvm(zsh) with nvm-zsh

Easiest and most hassle free way as a zsh-plugin.

git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm

# load as plugin in .zshrc
plugins+=(zsh-nvm)

# restart zsh
source ~/.zshrc

Notes and Gotchas!

Sometimes, zsh will display compfix errors. A workaround is to add

# top of your .zshrc file
ZSH_DISABLE_COMPFIX=true

Also you might want to remove that annoying bell sound from terminal errors in zsh (source)

# .zshrc file
unsetopt beep

Hurray! Damn thing almost made me go insane.

Installing Node

We'll be install node and npm via a version manager called nvm. Since we've install zsh and oh-my-zsh we can make use of their package manager and install zsh-nvm

clone zsh-nvm into your custom plugins

git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm

then load in .zshrc in their plugins field

plugins=(... zsh-nvm)

Then install lastest version of node

nvm install node

Check if you have both node and npm

node -v
npm -v

Pesto! You have node!

References

wsl-guide. reference for installing ubuntu with a unix account

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