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.
[!note] The demo is slightly outdated and does not show solution auto-discovery or caching.
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.
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.
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
},
-- 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" },
}
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:
.sln file exists in the current working directory or any subdirectory, it will be used automatically..sln files are found under the current working directory, you will be prompted to choose one.If you want to change the selected solution without restarting Neovim, see the command below.
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
| Command | Description |
|---|---|
| AddNugetToProject | Add a nuget package to a project |
| RemoveNugetFromProject | Remove a nuget package from a project |
| UpdateNugetsInProject | Update all nuget packages in the chosen project |
| UpdateNugetsInSolution | Update all nuget packages in the chosen solution |
| AddProjectToProject | Add a project as reference in another |
| RemoveProjectFromProject | Remove a project as reference in another |
| AddProjectToSolution | Add a project to the solution file |
| ForgetCachedSolutionFile | Forget the cached solution choice for the current working dir |
To run tests:
nvim --headless --noplugin -u tests/minimal.vim -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/minimal.vim'}"
Issafalcon - for being patient with questions and giving me clues on what to look into.