Neovim for Beginners —Common Language Servers

Configure common language servers for daily coding.

alpha2phi
5 min readJun 12, 2022

--

Neovim for Beginners — Common Language Servers

We configured the jsonls language server and the plugin for the JSON Schema Store. This article will walk through the configuration of other language servers for commonly used tools and utilities.

This article is part of the Neovim for Beginners series.

The Neovim configuration files can be found in this repository.

Docker

Most developers should be familiar with Docker and how to create a Dockerfile. Let’s install the Docker language server to help us write Dockerfile.

In the lua/config/lsp/init.lua file, add the line for the dockerls language server.

local servers = {
...
dockerls = {},
...
}

Once we restart Neovim, the nvim-lsp-installer plugin will install the Docker language server automatically. The automated installation is configured in the lua/config/lsp/installer.lua file.

Docker Language Server Installation

Alternatively, we can use the :LspInstallInfo command to manually install the language server.

Docker Language Server Installation

Now if we open any Dockerfile the completion should work.

Docker LSP Completion

YAML

For YAML, we can use the yaml-language-server.

In the lua/config/lsp/init.lua file, add the line for the yamlls language server.

local servers = {
...
yamlls = {},
...
}

Open any YAML file, and the language server should work.

YAML Language Server

Bash

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.