# Neovim Configuration A modern, fast, and well-organized Neovim configuration built with Lua. ## Requirements - **Neovim**: 0.9+ (0.10+ recommended) - **Git**: For plugin management - **Node.js**: For LSP servers and tooling - **ripgrep** (`rg`): For fast file searching - **Python 3**: With `pynvim` package for Python support ### Optional Dependencies - **Pandoc**: For HTML to Markdown conversion - **Prettier**: For code formatting - **Stylua**: For Lua formatting ## Installation ```bash # Backup existing config (if any) mv ~/.config/nvim ~/.config/nvim.bak # Clone this configuration git clone ~/.config/nvim # Start Neovim (plugins will auto-install) nvim ``` ## Structure ``` ~/.config/nvim/ ├── init.lua # Entry point ├── lua/cargdev/ │ ├── core/ │ │ ├── init.lua # Core initialization │ │ ├── options.lua # Neovim options │ │ ├── keymaps/ # Keymap modules │ │ │ ├── init.lua # Keymap loader │ │ │ ├── general.lua # General keymaps │ │ │ ├── personal.lua # Personal workflow keymaps │ │ │ ├── plugins.lua # Plugin-specific keymaps │ │ │ ├── window.lua # Window management │ │ │ ├── lsp.lua # LSP keymaps │ │ │ ├── copilot.lua # Copilot keymaps │ │ │ └── ... │ │ └── function/ # Custom functions │ ├── plugins/ # Plugin configurations │ │ ├── lsp/ # LSP-related plugins │ │ └── ... │ └── lazy.lua # Lazy.nvim setup └── ftplugin/ # Filetype-specific settings ``` ## Key Features - **Colorscheme**: [cargdev-cyberpunk](https://github.com/CarGDev/cargdev-cyberpunk) - Vibrant cyberpunk theme with neon colors and full TypeScript/LSP support - **Plugin Manager**: [lazy.nvim](https://github.com/folke/lazy.nvim) with auto-update notifications - **LSP**: Full LSP support with Mason for easy server management - **Completion**: nvim-cmp with multiple sources - **File Navigation**: Snacks.nvim (modern) + Telescope (git features) - **File Explorer**: nvim-tree - **Git Integration**: LazyGit, Gitsigns - **AI Assistants**: GitHub Copilot + [Avante.nvim](https://github.com/yetone/avante.nvim) (local LLM support) - **Debugging**: DAP with UI (Java, Node.js/NestJS, Python) - **Formatting**: Conform.nvim with auto-format on save - **Diagnostics**: Trouble.nvim for organized diagnostics view ## Documentation | Document | Description | |----------|-------------| | [CHANGELOG.md](./CHANGELOG.md) | Version history and changes | | [keyboard_mappings.md](./keyboard_mappings.md) | QMK keyboard configuration | | [NATIVE_AUTO_WRAPPER_GUIDE.md](./NATIVE_AUTO_WRAPPER_GUIDE.md) | Text wrapping configuration | | [TELESCOPE_TO_SNACKS_MIGRATION.md](./TELESCOPE_TO_SNACKS_MIGRATION.md) | Migration notes | ## Quick Reference - Essential Keymaps ### Leader Key: `` ### File Operations | Keymap | Description | |--------|-------------| | `w` | Save file | | `q` | Close file | | `xa` | Save and close all | | `bd` | Close buffer (safe) | | `bD` | Force close buffer | ### Navigation | Keymap | Description | |--------|-------------| | `ff` | Find files | | `fs` | Live grep (search text) | | `fr` | Recent files | | `fb` | Find buffers | | `e` | Toggle file explorer | ### Window Management | Keymap | Description | |--------|-------------| | `sv` | Split vertical | | `sh` | Split horizontal | | `se` | Equal splits | | `sx` | Close split | | `` | Resize splits | ### LSP | Keymap | Description | |--------|-------------| | `gd` | Go to definition | | `gr` | Show references | | `K` | Hover documentation | | `ca` | Code actions | | `rn` | Rename symbol | | `f` | Format buffer | | `mm` | Format (conform) | ### Git | Keymap | Description | |--------|-------------| | `gg` | LazyGit | | `gs` | Git status | | `gb` | Git blame | ### Diagnostics & Quickfix | Keymap | Description | |--------|-------------| | `xx` | Toggle Trouble | | `xd` | Document diagnostics | | `qn/qp` | Next/prev quickfix | | `qo/qq` | Open/close quickfix | ### Session | Keymap | Description | |--------|-------------| | `sS` | Save session | | `sR` | Restore session | ### Copilot | Keymap | Description | |--------|-------------| | `` | Accept suggestion | | `zc` | Open Copilot Chat | | `ze` | Explain code (visual) | | `zf` | Fix code (visual) | ### Debugging (DAP) | Keymap | Description | |--------|-------------| | `dcr` | Start/Continue Debugging | | `db` | Toggle Breakpoint | | `dB` | Conditional Breakpoint | | `do` | Step Over | | `di` | Step Into | | `dot` | Step Out | | `du` | Toggle DAP UI | | `dq` | Stop Debugging | | `dr` | Open REPL | | `dl` | Run Last Debug | | `dcf` | DAP Configurations | | `dcb` | List Breakpoints | | `dco` | DAP Commands | ### Java Debugging | Keymap | Description | |--------|-------------| | `jd` | Debug Class (DAP) | | `jt` | Test Class | | `jn` | Test Nearest Method | | `jr` | Run Java File | | `jm` | Run Maven Project | | `jg` | Run Gradle Project | ## Commands | Command | Description | |---------|-------------| | `:Lazy` | Open plugin manager | | `:Mason` | Open LSP server manager | | `:checkhealth` | Run health checks | | `:CheckConfig` | Run config validation | | `:FormatToggle` | Toggle auto-format on save | ## Debugging Setup This configuration includes full debugging support for multiple languages using DAP (Debug Adapter Protocol). ### Supported Languages | Language | Debug Adapter | Configuration | |----------|---------------|---------------| | **Java** | java-debug-adapter | Auto-configured via nvim-jdtls | | **Node.js/NestJS/TypeScript** | js-debug-adapter (pwa-node) | Launch & Attach configurations | | **Python** | debugpy | Django, FastAPI, Flask, and general Python | ### Debug Configurations #### Node.js/NestJS/TypeScript - **Launch NestJS** - Runs `dist/main.js` with source maps - **Launch Current File** - Debug the current TypeScript/JavaScript file - **Launch with ts-node** - Debug TypeScript directly without compilation - **Attach to NestJS** - Attach to running process on port 9229 - **Attach to Process** - Pick from running Node.js processes #### Python - **Launch File** - Debug current Python file - **Launch with Arguments** - Debug with custom arguments - **Attach Remote** - Attach to debugpy server (port 5678) - **Django** - Debug Django with `manage.py runserver` - **FastAPI** - Debug FastAPI with uvicorn - **Flask** - Debug Flask application #### Java - Auto-discovers main classes and test methods - Hot code replacement enabled - Use `jd` to debug the current class ### Installation Debug adapters are automatically installed via Mason. Run `:Mason` to verify: - `debugpy` - Python debugger - `js-debug-adapter` - Node.js/TypeScript debugger - `java-debug-adapter` - Java debugger - `java-test` - Java test runner ## Troubleshooting ### Check Configuration Health ```vim :checkhealth :CheckConfig ``` ### Common Issues 1. **Plugins not loading**: Run `:Lazy sync` 2. **LSP not working**: Run `:Mason` and install required servers 3. **Formatting not working**: Ensure formatters are installed (prettier, stylua, etc.) 4. **Slow startup**: Check `:Lazy profile` for slow plugins ## License MIT License - Feel free to use and modify as needed.