Using Neovim in Gitpod

I’m going to show you how to use Neovim on Gitpod. This can be useful for checking and testing your Neovim configuration.

The example can be found here: https://github.com/LorenzoBettini/neovim-gitpod-example.

I’m using a LazyVim distribution as a demonstration.

The Gitpod custom Dockerfile, “.gitpod.Dockerfile”, must be tweaked to install Neovim and its requirements (especially for using Lazyvim):

Then, the file “.gitpod.yml” must be tweaked accordingly; in particular, I’m using “stow” to create a symlink for the default Neovim configuration directory using as the source the configuration directory of this repository (you could also simply use the “ln” command for that):

The “stow.sh” script is part of the repository. I also specify a few extensions to install in the VScode of Gitpod.

Note that the first time, it will take a few minutes for Gitpod to provision such a Docker image.

Once in Gitpod, we can see that the link has been already configured:

Now, let’s enlarge the Terminal view and start Neovim.

We should see Neovim is installing all the packages as configured by LazyVim:

Note the change of the default color scheme:

Let’s close the Lazy window and see the Dashboard:

Since I’m using a light theme for the VScode, upon restarting Neovim, the color scheme is changed to its light variant as well:

We can now open the explorer (“space e”) to browse the contents:

By default, we have the Lua LSP installed.

We can use the file picker (“space f”):

We can use Lua LSP features like code completion:

And hover (“K”):

And change the color scheme with the picker (“space u C”):

Note that there are a few things that are not working correctly in Gitpod concerning Neovim:

  • Clipboard does not work since there’s no “DISPLAY” set.
  • Missing nerd fonts, things like folders and file types in the explorer, are not rendered correctly.

That’s all!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.