How do you write C# for mac?

Official SDK for macOS (make sure to pick the right one, arm64 or x64): https://dotnet.microsoft.com/en-us/download/dotnet/7.0

Then, an IDE of your preference:

- VS Code: install C# extension and Roslynator (it adds useful analyzers)

- Rider: provides everything out of box, is more user-friendly (especially for people who used to big and fully-fledged solution) and has much superior debugging capabilities but is paid and has higher memory and battery consumption

Thanks, is there any way to do this without an IDE? I use vim

And before someone says "that's impossible, even vanilla macOS development forces you to use Xcode", nope that's not true. You can compile macOS apps with clang just fine.

You can probably use omnisharp-vim (OmniSharp is the same tech that powers VS Code's C# experience).

https://github.com/OmniSharp/omnisharp-vim