Post

Setting Up Ubuntu or WSL for Zsh + Oh My Zsh + Neovim (LazyVim)

Setting Up Ubuntu or WSL for Zsh + Oh My Zsh + Neovim (LazyVim)

This is just a quick reference for commands to set up development environment on Ubuntu or WSL. You will install Zsh, Oh My Zsh, Powerlevel10k, NerdFonts, and Neovim with LazyVim.

The steps work for both Ubuntu Desktop and WSL.

1. Install Zsh

1
2
sudo apt update
sudo apt install zsh -y

2. Install Oh My Zsh

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

3. Install Nerd Fonts

Nerd Fonts enable icons for Powerlevel10k and Neovim.

Ubuntu Desktop

1
2
3
4
5
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/CascadiaMono.zip
unzip CascadiaMono.zip
fc-cache -fv

WSL Users

Install the font directly in Windows, then set it in Windows Terminal → Settings → Ubuntu → Font face.


4. Install Powerlevel10k

1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git   ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k

Edit .zshrc:

1
ZSH_THEME="powerlevel10k/powerlevel10k"

5. Switch to Zsh

1
exec zsh

6. Configure Powerlevel10k

1
p10k configure

7. Install Neovim from GitHub

1
2
wget https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz
tar xvf nvim-linux64.tar.gz

8. Move Neovim to /opt/nvim

1
sudo mv nvim-linux64 /opt/nvim

9. Add Neovim to PATH

1
2
echo 'export PATH="/opt/nvim/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

10. Install LazyVim

Backup old config:

1
mv ~/.config/nvim ~/.config/nvim.bak

Install:

1
2
git clone https://github.com/LazyVim/starter ~/.config/nvim
rm -rf ~/.config/nvim/.git

Run nvim and let Lazyvim install the plugins.

1
nvim

11. Install Required Tools

1
2
3
sudo add-apt-repository ppa:lazygit-team/release -y && \
sudo apt update && \
sudo apt install -y ripgrep fd-find luarocks lazygit build-essential && \

Open nvim and perform Health check:

1
:checkhealth

Check for the missing tools. Install Node.


Extra Notes for WSL Users

  • Install fonts in Windows, not Linux.
  • Clipboard support:
1
sudo apt install xclip wl-clipboard -y
This post is licensed under CC BY 4.0 by the author.