A fully-featured Neovim configuration optimized for C# / .NET development on macOS. Includes Roslyn LSP, debugging with netcoredbg, unit testing with Neotest, and 50+ carefully configured plugins.
- Roslyn Language Server - Modern C# LSP with intelligent code analysis
- Integrated Debugging - netcoredbg with DAP UI, breakpoints, watches, and REPL
- Unit Testing - Neotest integration with test running and debugging
- .NET Build Integration - Direct
dotnet buildwith quickfix error navigation - VS Code Compatibility - Reads
launch.jsonandsettings.jsonconfigurations - macOS ARM64 Optimized - Native Apple Silicon debugger and clipboard support
- Neovim 0.9+
- .NET SDK 8.0+
- macOS (ARM64/Apple Silicon)
- Git
- fzf (for fuzzy finding)
- A Nerd Font (for icons)
# Backup existing config
mv ~/.config/nvim ~/.config/nvim.bak
# Clone this repository
git clone https://github.com/Eftiand/neovim-csharp-config.git ~/.config/nvim
# Open Neovim - plugins will install automatically
nvim~/.config/nvim/
├── init.lua # Entry point
├── lazy-lock.json # Plugin version locks
└── lua/meon/
├── core/
│ ├── options.lua # Editor settings
│ └── keymaps.lua # Key bindings
├── lazy.lua # Plugin manager setup
├── plugins/
│ ├── lsp/
│ │ ├── roslyn.lua # C# language server
│ │ ├── lspconfig.lua
│ │ └── mason.lua
│ ├── nvim-dap.lua # Debug adapter
│ ├── nvim-dap-ui.lua # Debug UI
│ ├── neotest.lua # Test runner
│ └── [...] # 50+ plugin configs
└── util/
└── json5.lua # VS Code launch.json parser
Leader key: <Space>
| Key | Action |
|---|---|
gd |
Go to definition |
gD |
Go to declaration |
gi |
Go to implementations |
gr |
Go to references |
gt |
Go to type definition |
K |
Hover documentation |
<leader>ca |
Code actions |
<leader>rn |
Rename symbol |
<leader>D |
Document diagnostics |
<leader>d |
Line diagnostics |
| Key | Action |
|---|---|
<leader>bp |
Build project (dotnet build) |
<F5> |
Continue / Start debugging |
<F9> |
Toggle breakpoint |
<F10> |
Step over |
<F11> |
Step into |
<F8> |
Step out |
<leader>du |
Toggle DAP UI |
<leader>dw |
Watch variable |
<leader>dr |
Open REPL |
| Key | Action |
|---|---|
<leader>tr |
Run nearest test |
<leader>tf |
Run file tests |
<leader>td |
Debug nearest test |
<leader>ts |
Toggle test summary |
<leader>to |
Open test output |
<leader>tx |
Stop tests |
| Key | Action |
|---|---|
<leader>ff |
Find files |
<leader>fa |
Find all files (including hidden) |
<leader>fr |
Recent files |
<leader>fs |
Live grep |
<leader>fc |
Grep word under cursor |
<leader>ft |
Find TODOs |
| Key | Action |
|---|---|
<leader>ha |
Add file to harpoon |
<leader>hh |
Open harpoon menu |
<leader>1-4 |
Jump to harpooned file 1-4 |
| Key | Action |
|---|---|
sh |
Split vertical |
sv |
Split horizontal |
se |
Equal split sizes |
sx |
Close split |
<leader>sm |
Maximize/restore window |
| Key | Action |
|---|---|
jk |
Exit insert mode |
<leader>nh |
Clear search highlights |
<leader>rr |
Reload config |
T |
Toggle floating terminal |
:Ofinder |
Open current file in Finder |
The configuration uses roslyn.nvim for C# language support. It automatically activates for .cs files with optimized settings:
- Background analysis scoped to open files (better performance)
- Inlay hints disabled for cleaner code view
- Full diagnostics from analyzers and compiler
Debugging uses netcoredbg compiled for macOS ARM64. The debugger is bundled via netcoredbg-macOS-arm64.nvim.
To debug a project:
- Create a
.vscode/launch.jsonin your project (VS Code format supported) - Set breakpoints with
<F9> - Start debugging with
<F5>
Example launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/bin/Debug/net8.0/YourApp.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false
}
]
}Press <leader>bp to build your solution. The command:
- Reads
.vscode/settings.jsonfordotnet.defaultSolution - Falls back to finding
.slnor.slnxfiles - Runs
dotnet buildwith live output - Opens quickfix list on errors
Testing uses neotest with neotest-dotnet.
<leader>tr- Run the test under cursor<leader>td- Debug the test under cursor<leader>ts- View test summary panel
- lazy.nvim - Plugin manager
- mason.nvim - LSP/DAP/linter installer
- nvim-treesitter - Syntax highlighting
- nvim-cmp - Autocompletion
- fzf-lua - Fuzzy finder
- harpoon - Quick file switching
- leap.nvim - Fast cursor movement
- nvim-tree.lua - File explorer
- onedark.nvim - Color scheme with C# enhancements
- lualine.nvim - Status line
- bufferline.nvim - Tab bar
- alpha-nvim - Dashboard
- trouble.nvim - Diagnostics list
- gitsigns.nvim - Git integration
- todo-comments.nvim - Highlight TODOs
- which-key.nvim - Keybinding hints
- System clipboard - Uses
pbcopy/pbpastefor seamless copy/paste - ARM64 debugger - Native Apple Silicon netcoredbg
- Finder integration -
:Ofinderreveals file in Finder - Tmux navigation - Seamless pane switching with vim-tmux-navigator
Create a new file in lua/meon/plugins/ with a lazy.nvim spec:
return {
"author/plugin-name",
config = function()
require("plugin-name").setup({})
end,
}Edit lua/meon/core/keymaps.lua to add or change key bindings.
Edit lua/meon/plugins/colorscheme.lua to modify colors or switch themes.
- Ensure .NET SDK 8.0+ is installed:
dotnet --version - Check Mason installed the server:
:Masonand look forroslyn - View LSP logs:
:LspLog
- Verify netcoredbg path exists:
~/.local/share/nvim/lazy/netcoredbg-macOS-arm64.nvim/netcoredbg/netcoredbg - Check
launch.jsonsyntax is valid - Ensure project is built before debugging
- Run
:Lazyto check plugin status - Try
:Lazy syncto update plugins - Check for errors:
:messages
MIT