easy-dotnet.nvim
easy-dotnet.nvim copied to clipboard
document the best way to get started
at least on windows, there are a couple of approaches to installing neovim. Chocolatey, WSL 2, Virtualbox+linux distro
can we make an easy to follow guide for newcommers being interested in using neovim for C#.. for someone who only knows sat visual studio. What is the tested/recommended approach.
Yeah that wouldnt be a dumb idea. When it comes to installing neovim I guess there is a lot of material out there already. But for getting started with C# in neovim, definitely!
When it comes to installing I prefer chocolatey because its so simple to upgrade. WSL also works nice if you want to work on Linux. But all in all it doesnt matter how you install it
Ok let me elaborate. If i install using choco i also need a c compiler or zig, ripgrep and other packages.
What about other dependencies. Im thinking mason etc or are all just dependencies loaded by your plugin automatically by a package manager?
Further, are you using neovim from within vscode or plain?
How to best associate files with neovim loading your plugin? I assume you dont want it loaded for non cs ?
Consider mapping eg f-keys so you can easily rename f2, next search f3, save+start f5, break point f9, f10 debug, f12 goto impl and s-f12 for references.. so at least some mappings are familiar
Maybe we can do a video where we setup my machine from scratch? :)
Ah I see. Doing a video would be cool, and probably helpful for a bunch of other people getting started.
Just to help anyone stumbling across this issue I will answer your questions
- I use zig compiler because it was the easiest to install
- easy-dotnet.nvim doesnt rely on Mason
- easy-dotnet.nvim does rely on plenary.nvim and telescope which if you are using lazy.nvim will automatically be installed if you follow the readme
- I would not recommend associating files to the plugin, as most of its features are buffer independent
- Im using this plugin from neovim, I dont know of anyone using it through vscode and cant guarantee it even works
Maybe a good thread to mention the version of neovim you need in order to install this plugin. I tried on 0.9.5 and wasn't able, but upgrading to 0.10.2 worked. AFAIK this plugin uses a neovim builtin called vim.iter which is only available from version 0.10 onwards, yet the version information is not listed anywhere in the documentation of this plugin.
@jorgevds Ah good catch, I wasnt aware that iter is not available in 0.95, its a recent change I will revert it. I want to target 0.95 aswell
@jorgevds I tried to remove all new features that isnt available in 0.9.5 but its gonna take quit a bit of work. Being worked on in #205. I updated the readme in #206 to reflect the requirement
@GustavEikaas looking great. Thanks for taking the time to do this!
How to best associate files with neovim loading your plugin? I assume you dont want it loaded for non cs ?
I'm late to the party 😆 .
If you want to lazy load the plugin you can set the ft and/or the cmd property when loading the plugin:
{
"GustavEikaas/easy-dotnet.nvim",
ft = { "cs", "csproj", "sln", "slnx", "props", "csx", "targets" },
cmd = "Dotnet",
opts = {}
}
@GustavEikaas Out of curiosity, do you use Neovim on Windows? If yes, how is the performance? I am asking in general, not in terms of this plugin specifically and wanted to check if others have similar experience cause using the same config on WSL2 is just way faster.
I am using LazyVim with roslyn.nvim (within Wezterm) , I know that mainly it can be caused due to git just being slower on Windows
At work I mostly do .Net framework development so I am using neovim with windows without WSL. Performance is pretty crap comparing to on linux, the codebase I am working with is pretty big making certain plugins/workflows unusable. At home i'm dualbooting arch and windows. Not using WSL at home either, mostly because I am trying to ensure cross platform compatibility for this plugin.
Here is my lazy.nvim startuptime, on arch im pretty sure its < 1 seconds.
The thing that is most noticeable in terms of lag in Windows neovim is the following
- Read/write operations to files
- Visual rendering (windows terminal/powershell). (stuff like floating windows inside neovim like e.g telescope)
@GustavEikaas , you mentioned you use Arch with this plugin as well and this makes me wonder: does this plugin work well on Linux? Reading through the ReadMe makes me think that Windows is required for the MSBuild and some Nuget stuff; is that correct?
I'm looking into doing C# .NET 9+ development on my linux laptop and I agree with what was said before in this discussion, a getting-started would help greatly (if possible)! I'm currently hitting some issues when opening a directory with C# files, that I think are caused by prerequisites of easy-dotnet.nvim not being met (but I'm not sure because I'm using a batteries-included setup of nvim, which includes a lot of other plugins as well):
Error: dotnet server exited with code 1[server stderr] Could not execute because the specified command or file was not found.
Works for all OS'es as long as you are targeting net8 or higher. I think the reason it's not working for you is because you do not have dotnet tools set up in your shell path?
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install
If you are using bash you need to edit your .bashrc and add the following line
export PATH="$PATH:$HOME/.dotnet/tools
EDIT3: Duh! Of course it's the easy-dotnet-server! Alright, I'll try to install that in advance and see if I can get things to work 🏗️ . (And sorry for hijacking this thread)
EDIT2: If possible I'd like to stick to Nix (Shell); does easy-dotnet.nvim install any tools or does it just access some? (Then I could install these in advance)
EDIT: I re-read your comment and notice that you actually mention dotnet tools, so I'll look into that! Thanks for the clue 🙏
Thank you for your response! Ah okay, then I'll need to put some more time into identifying the cause of my issue; I found these snippets in the ReadMe and thought this would be the issue.
I should have dotnet in my path. However, I use a Nix Shell and am still quite new to it, so there's probably something I'm doing wrong there. Thanks again for your help, I'm looking forward to using your plugin!
Yes, if you can get this command to work in your shell dotnet easydotnet, then it should also work in neovim