This guide helps you set up HyperJS and Oh My Zsh on Windows Subsystem for Linux 2 (WSL2) with custom configurations.
- Windows 10 Version 1903 or higher, or Windows 11.
- Administrator privileges on your Windows system.
Open Command Prompt as Administrator and run:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart your computer.
Download and install the Linux kernel update package from this link.
If you want Docker, download Docker Desktop from this link.
Open Command Prompt or PowerShell and run:
wsl --set-default-version 2
- Open Microsoft Store and search for "Ubuntu".
- Install your preferred version (e.g., Ubuntu 22.04 LTS).
-
Launch Ubuntu from the Start menu.
-
Create a new user and password.
Optional: To avoid password prompts for
sudo
commands, edit the sudoers file:sudo nano /etc/sudoers
Add the following line:
yourusername ALL=(ALL:ALL) NOPASSWD:ALL
Save and exit (Ctrl + O, Enter, Ctrl + X).
-
Update and upgrade Ubuntu:
sudo apt update sudo apt upgrade
-
Install Zsh and Powerline fonts:
sudo apt install zsh sudo apt install powerline fonts-powerline
-
Set Zsh as the default shell:
chsh -s /bin/zsh
Then restart your terminal If prompted to select a configuration file, press
q
. -
Install Oh My Zsh:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
Restart the terminal.
Syntax Highlighting:
-
Install the plugin:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
-
Edit
~/.zshrc
and addzsh-syntax-highlighting
to the plugins list:plugins=( [plugins...] zsh-syntax-highlighting)
-
Restart the terminal.
Auto Suggestions:
-
Install the plugin:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
-
Edit
~/.zshrc
and addzsh-autosuggestions
to the plugins list:plugins=( [other plugins...] zsh-autosuggestions)
-
Restart the terminal.
Spaceship Prompt:
-
Install Spaceship prompt:
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
-
Create a symlink:
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
-
Edit
~/.zshrc
to set Spaceship as the theme:ZSH_THEME="spaceship"
-
Add custom Spaceship settings to
~/.zshrc
under the #User settings section:LS_COLORS=$LS_COLORS:'ow=01;34:' ; export LS_COLORS SPACESHIP_PROMPT_ORDER=( user # Username section dir # Current directory section host # Hostname section git # Git section (git_branch + git_status) hg # Mercurial section (hg_branch + hg_status) exec_time # Execution time line_sep # Line break jobs # Background jobs indicator exit_code # Exit code section char # Prompt character ) SPACESHIP_USER_SHOW="always" # Shows System user name before directory name SPACESHIP_PROMPT_ADD_NEWLINE=false # SPACESHIP_PROMPT_SEPARATE_LINE=false # Make the prompt span across two lines # SPACESHIP_DIR_TRUNC=1 # Shows only the last directory folder name SPACESHIP_CHAR_SYMBOL_SUCCESS='❯' SPACESHIP_CHAR_SYMBOL_FAILURE='❯' SPACESHIP_CHAR_SUFFIX=" "
-
Restart the terminal.
-
Download and install Hyper from their website.
-
Open Hyper and install the following plugins:
hyper install hyper-custom-controls hyper install hyper-omni-theme hyper install hyperborder
-
Modify Hyper's configuration:
-
Open Hyper's settings (
Ctrl + ,
). -
Update
shell
andshellArgs
:shell: 'wsl.exe', shellArgs: ['-d', 'Ubuntu-22.04'],
-
Set
showHamburgerMenu
tofalse
:showHamburgerMenu: false
-
-
Save the configuration and restart Hyper.
You now have a stylish and functional terminal setup with HyperJS and Oh My Zsh on WSL2. Enjoy the enhanced terminal experience!
Feel free to adjust configurations according to your preferences. For additional support, refer to the documentation of each tool or their respective communities.