102 lines
2.6 KiB
Markdown
102 lines
2.6 KiB
Markdown
# System Patterns
|
|
|
|
## Architecture Patterns
|
|
|
|
### 1. Plugin System
|
|
- Uses `lazy.nvim` for plugin management.
|
|
- Plugins are defined in `init.lua`.
|
|
- Supports lazy loading via events/commands.
|
|
- Custom plugins can be added in `lua/custom/plugins/`.
|
|
|
|
### 2. Configuration Structure
|
|
```
|
|
.
|
|
├── init.lua # Main configuration file
|
|
├── lua/
|
|
│ ├── kickstart/ # Core functionality
|
|
│ │ └── plugins/ # Built-in plugin configs
|
|
│ └── custom/ # User customizations
|
|
│ └── plugins/ # Custom plugin configs
|
|
└── doc/ # Documentation
|
|
```
|
|
|
|
### 3. Key Design Patterns
|
|
|
|
#### Modular Configuration
|
|
- Core settings in `init.lua`.
|
|
- Plugin-specific configurations in separate files.
|
|
- Custom configurations isolated in `lua/custom/`.
|
|
|
|
#### Event-Driven Architecture
|
|
- Uses Neovim's event system for plugin loading.
|
|
- Autocommands for specific behaviors.
|
|
- LSP events for IDE features.
|
|
|
|
#### Layer-Based Organization
|
|
1. **Core Settings Layer**
|
|
- Basic Vim options.
|
|
- Key mappings.
|
|
- Global variables.
|
|
|
|
2. **Plugin Layer**
|
|
- Plugin management.
|
|
- Plugin configurations.
|
|
- Plugin-specific settings.
|
|
|
|
3. **LSP Layer**
|
|
- Language server configurations.
|
|
- Completion setup.
|
|
- Diagnostic settings.
|
|
|
|
4. **UI Layer**
|
|
- Colorscheme.
|
|
- Statusline.
|
|
- Visual enhancements.
|
|
|
|
## Technical Decisions
|
|
|
|
### 1. Configuration Language
|
|
- Lua chosen over VimScript for:
|
|
- Better performance.
|
|
- Modern syntax.
|
|
- Rich data structures.
|
|
- Better integration with Neovim.
|
|
|
|
### 2. Plugin Selection
|
|
- Minimal but powerful set of defaults.
|
|
- Focus on maintained, actively developed plugins.
|
|
- Preference for Lua-based plugins.
|
|
- Built-in LSP over CoC or similar alternatives.
|
|
|
|
### 3. Code Organization
|
|
- Single `init.lua` for easy understanding.
|
|
- Modular structure available through `kickstart-modular.nvim`.
|
|
- Clear separation between core and user customizations.
|
|
|
|
### 4. Performance Considerations
|
|
- Lazy loading of plugins.
|
|
- Efficient event handling.
|
|
- Minimal startup impact.
|
|
- Careful LSP configuration.
|
|
|
|
## Key Technical Standards
|
|
|
|
1. **Code Style**
|
|
- Consistent Lua formatting.
|
|
- Clear commenting.
|
|
- Documented configuration options.
|
|
|
|
2. **Plugin Management**
|
|
- Versioned dependencies.
|
|
- Conditional loading.
|
|
- Clear plugin specifications.
|
|
|
|
3. **Error Handling**
|
|
- Protected calls for plugin loading.
|
|
- Fallbacks for missing dependencies.
|
|
- Clear error messages.
|
|
|
|
4. **Documentation**
|
|
- Inline documentation.
|
|
- Help files.
|
|
- Clear user instructions. |