6.2 KiB
6.2 KiB
AstroNvim Plugin Structure
This document describes the complete plugin structure for your AstroNvim configuration.
📁 Directory Structure
lua/plugins/
├── README.md # Documentation and guide
├── astrocore.lua # Core settings, keymaps, autocmds (23KB)
├── astrolsp.lua # LSP, formatting, linting (23KB)
├── astroui.lua # UI configuration (8.3KB)
├── buildtools.lua # Build tools & dev environment (6.5KB)
├── bufferline.lua # Buffer/tab management (2.1KB)
├── claude.lua # Claude Code integration (1.3KB)
├── neotree.lua # File explorer (15KB)
├── _template-custom.lua # Template for custom plugins (disabled)
├── _template-filetype.lua # Template for filetype plugins (disabled)
├── _template-mason.lua # Template for Mason tools (disabled)
├── _template-treesitter.lua # Template for Treesitter (disabled)
└── _template-ui.lua # Template for UI plugins (disabled)
🎯 Active Plugin Files
Core Configuration (3 files)
-
astrocore.lua - Core AstroNvim functionality
- Session management
- Root detection (lsp, git)
- Features configuration
- Options (vim settings)
- Keymappings (extensive custom bindings)
- UI toggles (
<leader>uprefix)
-
astrolsp.lua - Comprehensive LSP & Tooling (CONSOLIDATED)
- LSP configurations (Go, TypeScript, Tailwind, HTML, CSS, Protobuf, JSON, YAML, Lua, Volar)
- Formatting (Conform.nvim with oxfmt, stylua, rustfmt, taplo)
- Linting (nvim-lint with oxlint, stylelint, markdownlint)
- Treesitter configuration
- TypeScript tooling (typescript-tools, autotag)
- Mason auto-installation
- Package management (package-info, crates.nvim)
- Diagnostics UI (Trouble, lsp_lines, nvim-bqf)
-
astroui.lua - UI/UX Configuration
- Colorscheme (cyberdream)
- Icons
- Statusline (Heirline)
- Status components
Feature Plugin Files (4 files)
-
buildtools.lua - Development Tools
- Treesitter (TOML, YAML, JSON parsers)
- SchemaStore (JSON/YAML schemas)
- Overseer (task runner for bun, vite)
- Trouble (diagnostics)
- Gitsigns (git integration)
- EditorConfig
- DevContainer support
-
bufferline.lua - Buffer Management
- Enhanced bufferline with diagnostics
- Custom close handlers
- Buffer groups support
- Icon integration
-
claude.lua - AI Assistant
- Claude Code integration
- Git root detection
- Custom commands and keybindings
- File explorer integration
-
neotree.lua - File Explorer
- Dynamic pattern filtering
- LSP file operations integration
- Snacks.rename integration (NEW)
- Custom keybindings for git, terminals, docker
- Custom commands (format, mason)
-
template.lua - Code Templates (NEW)
- Snacks picker integration
- 14 essential templates for Cosmos SDK, Protobuf, and Vite+Cloudflare
- Smart variable substitution
- Filetype-aware template filtering
📝 Template Files (5 files - disabled by default)
These files are prefixed with _template- and disabled with if true then return {} end.
Remove the first line to activate them.
- _template-custom.lua - Examples for adding custom plugins
- _template-filetype.lua - Filetype-specific configurations (Markdown, Rust, Python, Go, LaTeX)
- _template-mason.lua - Mason tool installer customization
- _template-treesitter.lua - Treesitter parser configuration
- _template-ui.lua - UI plugins and colorscheme examples
✅ Recent Changes
Consolidated Files
- ✅ tsx.lua → Merged into
astrolsp.lua - ✅ linting.lua → Merged into
astrolsp.lua
Added Features
- ✅ Snacks.rename integration in
neotree.lua - ✅ Snacks.toggle keymaps in
astrocore.lua(<leader>uprefix) - ✅ Proper
---@type LazySpecannotations on all files - ✅ Comprehensive documentation (README.md)
- ✅ Template files for common customizations
New Toggle Keybindings (<leader>u)
<leader>ud- Toggle diagnostics<leader>un- Toggle line numbers<leader>ur- Toggle relative numbers<leader>uw- Toggle line wrap<leader>us- Toggle spelling<leader>ui- Toggle inlay hints<leader>ut- Toggle treesitter<leader>uc- Toggle conceal<leader>uI- Toggle indent guides<leader>uz- Toggle zen mode<leader>uZ- Toggle zoom<leader>ua- Toggle animations<leader>uS- Toggle smooth scroll<leader>up- Toggle profiler<leader>uh- Toggle profiler highlights<leader>ux- Toggle dim inactive<leader>uf- Toggle format on save<leader>ul- Toggle LSP lines
Template Keybindings
<C-a><C-t>- Open template picker (Snacks integration)
📚 Documentation
All plugin files now include:
- ✅ Module documentation headers
- ✅
---@type LazySpecannotations - ✅ Detailed inline comments
- ✅ Proper lazy loading strategies
🎓 Quick Reference
Adding a New Plugin
- Create a new
.luafile inlua/plugins/ - Add module documentation and
---@type LazySpec - Return a table with plugin specifications
- Configure lazy loading (event, cmd, ft, keys)
Modifying Existing Config
- Core settings →
astrocore.lua - LSP/formatting/linting →
astrolsp.lua - UI/statusline →
astroui.lua - Keymaps →
astrocore.lua(mappings section)
Template Usage
- Copy a template file (remove
_template-prefix) - Remove
if true then return {} endline - Customize the configuration
- Save and restart Neovim
🔧 Useful Commands
:Lazy- Plugin manager:Mason- LSP/tool installer:AstroReload- Reload config:ConformInfo- Format status:FormatToggle- Toggle format on save:LspLinesToggle- Toggle inline diagnostics:checkhealth- Health check