A production-ready Neovim configuration built with nixCats, providing comprehensive IDE-like support for multiple programming languages with Language Server Protocol (LSP), debugging, formatting, and linting.
- Multi-Language Support: Dedicated packages for JavaScript/TypeScript, Java, C#, Zig, Rust, and R
- Language Servers: Full LSP configuration for code completion, diagnostics, and navigation
- Advanced Debugging: DAP (Debug Adapter Protocol) setup with language-specific configurations
- Code Formatting: Automatic formatting with language-specific formatters
- Code Linting: Real-time code quality checks
- Plugin Management: Lazy loading with lze instead of lazy.nvim
- Nix Integration: Declarative dependency management with Nix flakes
- Nix with flakes enabled
- Git
Clone and enter the configuration:
git clone https://github.com/yourusername/nvim-config.git
cd nvim-config
nix develop # or nix flake show to see available packagesEach package provides a specialized Neovim configuration for a specific language ecosystem:
| Package | Language | LSP | Debugger | Formatter | Use Case |
|---|---|---|---|---|---|
| jsvim | JavaScript/TypeScript | ts_ls | vscode-js-debug | prettier | Frontend/Node.js development |
| jvim | Java | jdtls | Built-in | - | Java application development |
| sharpvim | C# | OmniSharp | - | - | .NET development |
| zvim | Zig | zls | LLDB | zig fmt | Zig systems programming |
| rustvim | Rust | rust-analyzer | CodeLLDB | rustfmt | Rust development with clippy linting |
| rvim | R | languageserver | - | styler | R statistical analysis & data science |
| nvim | General | TypeScript-focused | Multi-lang | prettier | Default multi-language setup |
# JavaScript/TypeScript development
nix run .#jsvim
# Rust development with debugging
nix run .#rustvim
# Zig development
nix run .#zvim
# R statistical programming
nix run .#rvim
# Java development
nix run .#jvim
# C# .NET development
nix run .#sharpvim# Build and install a package
nix build .#rustvim
# Show all available packages
nix flake shownvim/
├── flake.nix # Nix configuration with package definitions
├── init.lua # Neovim entry point
├── lua/myLuaConf/
│ ├── init.lua # Main Lua configuration
│ ├── opts_and_keys.lua # Vim options and key mappings
│ ├── LSPs/ # Language server configurations
│ ├── debug/ # Debug adapter protocol setup
│ ├── format/ # Code formatting configuration
│ ├── lint/ # Code linting setup
│ └── plugins/ # Individual plugin configurations
├── lua/nixCatsUtils/ # nixCats utilities
└── after/plugin/ # Post-plugin configurations
- LSP: TypeScript Language Server with full TypeScript/JavaScript support
- Debugging: vscode-js-debug with launch/attach configurations
- Formatting: Prettier/Prettierd for consistent code style
- Features:
- Node.js ESM and CommonJS debugging
- Chrome/Browser debugging
- Jest test debugging
- Process attachment capabilities
- LSP: rust-analyzer with clippy integration for advanced linting
- Debugging: CodeLLDB for LLVM-based debugging
- Formatting: rustfmt for Rust code standards
- Tools: Cargo integration, clippy linting, all-features support
- Configurations:
- Debug and release binary launching
- Test execution and debugging
- Process attachment
- LSP: zls (Zig Language Server) with semantic tokens and inlay hints
- Debugging: LLDB for Zig program debugging
- Formatting: zig fmt integration
- Configurations: Program launch, test launch, process attachment
- LSP: R languageserver with rich documentation
- Formatting: styler for R code formatting
- Linting: lintr for code quality
- Format Support: .r, .rmd (R Markdown), .qmd (Quarto)
- Features: Multi-format support for statistical analysis and reporting
See flake.nix for detailed language-specific configurations.
Key Bindings:
<F5>- Start/Continue debugging<F1>- Step Into<F2>- Step Over<F3>- Step Out<leader>b- Toggle Breakpoint<leader>B- Set Conditional Breakpoint<F7>- Toggle DAP UI
Available configurations:
- Attach to Node.js (default port 9229)
- Attach to Node.js (custom port)
- Attach to running Node process (picker)
- Launch Chrome/Browser with custom URL
- Service-specific attach points
Start debugging:
# Terminal 1: Run your application with debug flag
node --inspect=9229 app.js
# Terminal 2: Open Neovim and press F5 to attach
nvim app.jsAvailable configurations:
- Launch Rust Program (Debug build)
- Launch Rust Program (Release build)
- Run Rust tests
- Attach to running process
Available configurations:
- Launch Zig Program (from zig-out/bin/)
- Launch Zig Test (from zig-cache/)
- Attach to running process
Files are automatically formatted on save with:
- JavaScript/TypeScript: Prettier
- Rust: rustfmt
- Zig: zig fmt
- R: styler
Press <leader>FF to manually format the current file.
Code quality checks run on buffer write:
- JavaScript/TypeScript: ESLint (commented, can enable)
- Rust: Clippy (integrated with rust-analyzer)
- R: lintr
Edit lua/myLuaConf/opts_and_keys.lua to customize:
- Vim options
- Key mappings
- Leader key bindings
- Add plugin to nixpkgs or create custom overlay
- Reference in flake.nix under appropriate category
- Configure in
lua/myLuaConf/plugins/
Edit flake.nix and add a new package definition:
customvim = { pkgs, ... }: {
settings = {
configDirName = "nvim";
wrapRc = true;
};
categories = {
markdown = true;
general = true;
rust = true; # Your desired language
# ... other categories
};
};Then build it:
nix build .#customvimThis configuration uses:
- nixCats: Declarative Neovim configuration framework
- lze: Lazy plugin loader with category support
- Nix Flakes: Reproducible dependency management
- LSPConfig: Neovim's standard LSP configuration
- DAP: Debug Adapter Protocol for debugging support
- Conform.nvim: Formatting management
- nvim-lint: Linting support
- Declarative: All dependencies and configurations defined in Nix
- Modular: Language support can be enabled/disabled per package
- Reproducible: Nix ensures everyone gets the same environment
- Zero Secrets: No credentials or personal information in configuration
-
Verify the language package is enabled:
nvim --version # Check NVIM version -
Check LSP status in Neovim:
:LspInfo
-
Enable debug logging:
:set loglevel=debug
- Ensure debug category is enabled for your language
- Check debug adapter installation:
:checkhealth - Verify you're using the correct debug configuration for your language
-
Clear plugin cache:
rm -rf ~/.cache/nvim -
Rebuild the flake:
nix flake update
Contributions are welcome! To add support for a new language:
-
Define the language in
flake.nix:- Add LSP server to
lspsAndRuntimeDeps - Add debug adapter if available
- Add formatter package
- Add debug category to
extraCats
- Add LSP server to
-
Configure LSP in
lua/myLuaConf/LSPs/init.lua -
Add debug configurations in
lua/myLuaConf/debug/init.lua -
Add formatter in
lua/myLuaConf/format/init.lua -
Create a new package definition following the existing patterns
See CONTRIBUTING.md for detailed guidelines.
- First launch may take time due to plugin compilation
- Subsequent launches are cached by Nix
- Use
:StartupTimeto profile startup performance
MIT License - see LICENSE for details
- nixCats - Neovim configuration framework
- lze - Lazy plugin loader
- Neovim - Hyperextensible Vim-based text editor
For issues and feature requests, please open an issue on GitHub. For general Neovim questions, see the Neovim documentation.
Made with ❤️ using Nix and Neovim