Member-only story
Neovim for Beginners — C#

In this article, we will configure Neovim for C# application development.
This article is part of the Neovim for Beginners series.
The Neovim configuration files can be found in this repository.
Getting Started
.NET SDK
Depending on the operating system, we need to install the .NET SDK.
For this article, we use a React-based Single Page Application (SPA). The application is created using the .NET CLI.
To start the React application, run the following commands.
# dotnet build
# dotnet run

If we click on the Fetch data
link on the top right, it calls the WeatherForecast
API and returns the forecast.

We will look at how to debug the API soon.
Language Server
We use OmniSharp as the language server. Since we already configured nvim-lsp-installer
, installing OmniSharp is easy.
In the lua/config/lsp/init.lua
, just add the line for OmniSharp.
local servers = {
....
omnisharp = {},
}
- We use the default configuration values and also do not pass in the
cmd
option as mentioned bynvim-lspconfig
. Thecmd
option will be configured bynvim-lsp-installer
automatically. - The language server is installed automatically once we restart Neovim. We install the server using the installer functions in the
lua/config/lsp/installer.lua
file.

The completion engine (using nvim-cmp
), auto-formatting, linting, code actions, highlighting, key mappings, and other LSP features should…