NeoVim configuration
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-05-29 15:45:40 +02:00
docs fix treesitter errors 2026-05-13 12:56:58 +02:00
lua improve colors for c# code 2026-05-29 15:45:40 +02:00
.gitignore document treesitter patch, update plugins 2026-04-21 20:11:17 +02:00
.stylua.toml prepare modular lsp config 2025-11-09 13:51:18 +01:00
CLAUDE.md update docs 2026-05-29 14:06:02 +02:00
init.lua prepare modular lsp config 2025-11-09 13:51:18 +01:00
keybindings.pdf add keybindings reference 2026-05-16 10:47:32 +02:00
lazy-lock.json update plugins 2026-05-29 13:56:55 +02:00
README.md update readme 2026-05-13 13:29:48 +02:00

nvim-config

A modular Neovim configuration built on lazy.nvim with a template-based LSP architecture for Neovim 0.12+.

Features

  • Modular LSP System: Template-based language modules with automatic tool installation
  • Native LSP API: Uses Neovim 0.11+ native LSP configuration (no lspconfig dependency)
  • Automatic Tool Management: Mason auto-installs LSP servers, formatters, linters, and debuggers
  • Smart Completion: Fast autocompletion with blink.cmp
  • Integrated Debugging: nvim-dap with pre-configured adapters per language
  • Testing Support: neotest with language-specific test adapters
  • Modern UI: Telescope, neo-tree, which-key, and lualine for a polished experience

Requirements

  • Neovim 0.12+ (uses native LSP configuration API)
  • Git
  • A Nerd Font (for icons)
  • ripgrep (for Telescope live grep)
  • Node.js (for some LSP servers)

Installation

  1. Backup your existing Neovim configuration:

    mv ~/.config/nvim ~/.config/nvim.backup
    mv ~/.local/share/nvim ~/.local/share/nvim.backup
    
  2. Clone this repository:

    git clone <your-repo-url> ~/.config/nvim
    
  3. Start Neovim:

    nvim
    
  4. Lazy.nvim will automatically install plugins, and Mason will install all configured language tools.

Project Structure

~/.config/nvim/
├── init.lua                    # Entry point: loads config and lsp modules
├── lua/
│   ├── config/
│   │   ├── init.lua            # Loads settings, keymaps, autocmds, then plugins
│   │   ├── settings.lua        # Vim options and global settings
│   │   ├── keymaps.lua         # Global and plugin-specific keybindings
│   │   └── plugins/            # Plugin definitions (one per file)
│   │       ├── init.lua        # Lazy.nvim setup
│   │       ├── lsp.lua         # Blink.cmp, lazydev, mason, conform
│   │       ├── lint.lua        # nvim-lint configuration
│   │       ├── debug.lua       # nvim-dap configuration
│   │       ├── test.lua        # neotest configuration
│   │       ├── test-adapters.lua  # neotest-vstest
│   │       ├── dotnet.lua      # .NET tooling (easy-dotnet.nvim)
│   │       ├── telescope.lua   # Fuzzy finder
│   │       ├── treesitter.lua  # Syntax highlighting
│   │       ├── theme.lua       # Colorscheme
│   │       ├── which-key.lua   # Keybinding hints
│   │       ├── neotree.lua     # File explorer
│   │       ├── lualine.lua     # Status line
│   │       ├── mini.lua        # Text objects & surround
│   │       ├── autopairs.lua   # Auto-close brackets
│   │       ├── indent.lua      # Indentation guides
│   │       ├── diffview.lua    # Git diff UI
│   │       ├── gitsigns.lua    # Inline git signs
│   │       └── render-markdown.lua  # Markdown rendering
│   └── lsp/
│       ├── init.lua            # LSP orchestration: loads language modules
│       ├── handlers.lua        # Shared LSP on_attach, capabilities, diagnostics
│       └── languages/          # Language-specific modules
│           ├── _template.lua   # Template for adding new languages
│           ├── lua.lua
│           ├── bash.lua
│           ├── markdown.lua
│           ├── nix.lua
│           ├── dotnet.lua      # .NET module (C#/F#/VB)
│           └── rust/           # Rust module (directory)
│               ├── init.lua    # Main Rust module definition
│               ├── build_manager.lua
│               ├── cargo_finder.lua
│               ├── debug_launcher.lua
│               ├── package_parser.lua
│               └── telescope_pickers.lua
└── CLAUDE.md                   # Development guidelines for Claude Code

Language Support

Currently Enabled

  • Lua: lua-language-server, stylua
  • C#/F#/VB (.NET): Roslyn LSP (via easy-dotnet.nvim), csharpier, netcoredbg
  • Bash: bash-language-server, shfmt, shellcheck, bash-debug-adapter
  • Markdown: marksman, markdownlint
  • Nix: rnix-lsp, nixfmt
  • Rust: rust-analyzer, codelldb

Adding a New Language

  1. Copy the template:

    cp lua/lsp/languages/_template.lua lua/lsp/languages/your_language.lua
    
  2. Fill in the module fields:

    • tools: Mason packages (LSP server, formatter, linter, DAP)
    • filetype: Vim filetype
    • lsp: Server name and settings
    • formatters: List for conform.nvim
    • linters: List for nvim-lint
    • dap: DAP adapter configuration (optional)
    • test(): Function returning neotest adapter (optional)
  3. Implement the setup() function following the pattern in the template

  4. Register the language: add to base_languages in lua/lsp/init.lua for always-on loading, or use the NVIM_LANGS env var for opt-in loading

Key Plugins

Core

  • lazy.nvim: Plugin manager
  • nvim-treesitter: Syntax highlighting and code understanding

LSP & Completion

  • blink.cmp: Fast autocompletion engine
  • lazydev.nvim: Lua development with proper vim.* completion
  • easy-dotnet.nvim: C# .NET development tooling
  • mason.nvim: Tool installer
  • mason-tool-installer.nvim: Automatic tool installation

Code Quality

  • conform.nvim: Code formatting
  • nvim-lint: Linting

Debugging & Testing

  • nvim-dap: Debug Adapter Protocol client
  • neotest: Testing framework

Git

  • diffview.nvim: Git diff and file history UI
  • gitsigns.nvim: Inline git signs, hunk staging/resetting

UI & Navigation

  • telescope.nvim: Fuzzy finder
  • neo-tree.nvim: File explorer
  • which-key.nvim: Keybinding hints
  • lualine.nvim: Statusline
  • render-markdown.nvim: Markdown rendering in buffer
  • oxocarbon: Color scheme

Utilities

  • LuaSnip: Snippet engine
  • mini.nvim: Collection of utilities (ai textobjects, surround, etc.)
  • nvim-autopairs: Auto-close brackets
  • guess-indent.nvim: Auto-detect indentation

Essential Keybindings

See lua/config/keymaps.lua for the complete reference.

LSP (defined in lsp/handlers.lua)

  • gra - Code actions
  • grn - Rename symbol
  • grr - Find references
  • grd - Go to definition
  • grD - Go to declaration
  • gri - Go to implementation
  • grt - Go to type definition
  • gO - Document symbols
  • gW - Workspace symbols
  • <leader>th - Toggle inlay hints

Navigation

  • <C-h/j/k/l> - Navigate windows
  • [d / ]d - Previous/next diagnostic
  • [q / ]q - Previous/next quickfix
  • gl - Show diagnostic float
  • <leader>e - Toggle file tree
  • <leader>sf - Search files
  • <leader>sg - Live grep
  • <leader><leader> - Search buffers
  • <leader>sh - Search help

Code

  • <leader>f - Format buffer

Testing

  • <leader>tt - Test nearest
  • <leader>tf - Test file
  • <leader>td - Debug test
  • <leader>ts - Test summary

Debugging

  • <F5> - Start/Continue
  • <F9> - Step out
  • <F10> - Step over
  • <F11> - Step into
  • <F7> - Toggle debug UI
  • <F4> - Stop debugging
  • <leader>b - Toggle breakpoint
  • <leader>B - Conditional breakpoint

Customization

Changing Settings

Edit lua/config/settings.lua for Vim options (tabstop, line numbers, etc.)

Adding/Removing Plugins

Add files to lua/config/plugins/ following the lazy.nvim spec format

Modifying Keybindings

Edit lua/config/keymaps.lua - plugin-specific keymaps use autocmds for lazy loading

Enabling/Disabling Languages

Add to base_languages in lua/lsp/init.lua for always-on loading, or set the NVIM_LANGS env var (e.g. in .envrc) for opt-in loading per project.

Development

Formatting

All Lua files use 2-space indentation. Run :lua vim.lsp.buf.format() or <leader>f to format.

Plugin Management

  • :Lazy - View plugin status
  • :Lazy update - Update all plugins
  • :Lazy sync - Install missing and remove unused plugins

Tool Management

  • :Mason - View installed tools
  • Tools are auto-installed based on enabled language modules

License

Personal configuration - use as you wish.