Neovim for Beginners —LSP using null-ls.nvim

Improve the built-in LSP using null-ls.nvim.

alpha2phi
5 min readFeb 12, 2022
Neovim for Beginners — null-ls.nvim

We configured the built-in Neovim LSP in the previous articles. However, depending on the language servers' implementation, some LSP features may not be available.

E.g. if we are using Pyright as the Python language server, the code formatting feature is not supported. Even if the feature is available, we may still want to use other tools for the same purpose.

There are several options available to complement the missing language server features, e.g. use a general-purpose language server like efm, or plugins like nvim-lintor null-ls.nvim to inject LSP diagnostics, code actions, and more by allowing third-party tools and utilities to hook into the LSP client.

In this article, we are going to

  • Configure the null-ls.nvim plugin for diagnostics/linting, code actions, formatting, and hover dictionary.
  • Configure auto-formatting.
  • Enhance the status line to display the third-party diagnostics and formatting tools used by null-ls.nvim.

This article is part of the Neovim for Beginners series.

The Neovim configuration files can be found in this repository.

Installation

--

--

alpha2phi
alpha2phi

Written by alpha2phi

Software engineer, Data Science and ML practitioner.

No responses yet