projektgunnar.nvim

December 19, 2025 ยท View on GitHub

Gunnar is the nice old Swedish man who helps you add projects or packages to dotnet solutions so you can take a Fika(tm) instead of having to remember how to do the different dotnet commands.

Demo

Note

The demo is slightly outdated and does not show solution auto-discovery or caching.

Demo

Why?

Everytime I wanted to add nugets, references to other projects or add a project to the solution I had to spend some time getting the dotnet commands right. It started to annoy me and so the idea of a plugin was born. This is a plugin that helps with those commands and allows you to run them from inside neovim without using a terminal.

Required system dependencies

dotnet must be installed and in the path. Install it using the way your OS allows.

For Arch Linux the command is pacman -S dotnet-sdk.

You also need nerdfonts patched version installed to get proper symbols. Get fonts from here.

How to install

Using lazy package manager:

"JesperLundberg/projektgunnar.nvim",
dependencies = {
    "folke/snacks.nvim" -- Choose either snacks.picker or
    "nvim-telescope/telescope.nvim", -- telescope...
    "nvim-mini/mini.pick", -- ...or mini.pick
},

Config

-- Default config
local defaults = {
	prefer = { "snacks", "telescope", "mini" },
}

-- If you have both and want mini.pick set mini as only (or first in the list) choice

local defaults = {
	prefer = { "mini" },
}

Solution file resolution

ProjektGunnar no longer assumes that the .sln file is located in the current working directory.

When you run a command that operates on a solution:

  • If a .sln file exists in the current working directory or any subdirectory, it will be used automatically.
  • If multiple .sln files are found under the current working directory, you will be prompted to choose one.
  • Your choice is cached per working directory, so you are only asked once.
  • Restarting Neovim clears the cache.

If you want to change the selected solution without restarting Neovim, see the command below.

Available commands

The way to use these commands has changed from the plugins inception. Now there is only the ProjektGunnar command that is supplied with the following commands.

Example (to add nuget to project):

:ProjektGunnar AddNugetToProject
CommandDescription
AddNugetToProjectAdd a nuget package to a project
RemoveNugetFromProjectRemove a nuget package from a project
UpdateNugetsInProjectUpdate all nuget packages in the chosen project
UpdateNugetsInSolutionUpdate all nuget packages in the chosen solution
AddProjectToProjectAdd a project as reference in another
RemoveProjectFromProjectRemove a project as reference in another
AddProjectToSolutionAdd a project to the solution file
ForgetCachedSolutionFileForget the cached solution choice for the current working dir

Local development

To run tests:

nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"

Credits

Issafalcon - for being patient with questions and giving me clues on what to look into.