Neovim for Beginners — LSP Plugins

LSP plugins to make Neovim a better code editor!

alpha2phi

--

Neovim for Beginners — LSP Plugins

Our configuration for the built-in LSP client should be fairly complete by now. We can use it to code in any programming language we prefer.

In this article, we are going to

  • Explore several language-specific LSP plugins to make Neovim a better code editor!
  • Configure which-key.nvim to trigger different commands based on the file type.

This article is part of the Neovim for Beginners series.

The Neovim configuration files can be found in this repository.

jsonls — SchemaStore.nvim

JSON schema store supports the schema for over 400 file types for almost all popular JSON documents. We configured jsonls as the language server for JSON files in the previous article. Let’s add additional settings to it to recognize the JSON schema.

In the lua/plugins.lua file, add the lines to install theschemastore.nvim plugin (line 11 and line 27).

In the lua/config/lsp/init.lua file, add the settings to configure the plugin (line 7 to line 11).

Run the :PackerInstall command to install the plugins.

Now when we open any application-related JSON configuration files, the completion menu should display the options based on the schema.

E.g. for package.json file,

package.json

E.g. for tsconfig.json file.

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.