Setting Up Neovim on WSL2
1 min readMar 2, 2021
Let’s keep this short and sweet, assumptions:
- You’ve set up WSL2
- You are using an Ubuntu distribution
Install & Configure NeoVim
Open an Ubunutu terminal
# add the repo
$ sudo add-apt-repository ppa:neovim-ppa/unstable
# update & install
$ sudo apt-get update
$ sudo apt-get install neovim
Setup init.vim
run $ nvim
, then:
# create a directory to hold the init.vim file
:call mkdir(stdpath('config'), 'p')
# then create an init.vim file
:exe 'edit '.stdpath('config').'/init.vim'
This is sourced from the :h nvim
command
Install vim-plug
download and install vim-plug:
$ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
Add some plugins
# edit the init.vim file
$ nvim ~/.config/nvim/init.vim
Sample plugin file
call plug#begin(stdpath('config') . '/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
call plug#end()
write the file and run $ nvim
again.
:PlugInstall
And you should be all set!