Member-only story

Neovim for Beginners — C#

Use Neovim for C# application development.

--

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
DotNet SPA

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

WeatherForecast API

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 by nvim-lspconfig. The cmd option will be configured by nvim-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.
OmniSharp Installation

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

--

--

alpha2phi
alpha2phi

Written by alpha2phi

Software engineer, Data Science and ML practitioner.

Responses (2)

Write a response