# stonelukas/lvim-ide architecture

> Architecture diagram of the GitHub repository stonelukas/lvim-ide, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stonelukas/lvim-ide
- Repository: https://github.com/stonelukas/lvim-ide

## Overview

##### Main Components Identification

The system should be represented with these primary components:

a) Core Layer:
- Configuration Management (/lua/core)
- Plugin Management (lazy.lua)
- Global Functions and Variables

b) Configuration Layer:
- Base Configurations (/lua/configs/base)
- User Configurations (/lua/configs/user)
- UI Components
- Keymaps

c) Language Support Layer:
- LSP Management
- Debug Adapters
- Formatters
- Linters

d) Module System:
- Base Modules (/lua/modules/base)
- User Modules (/lua/modules/user)
- Plugin Configurations

**User Interface Layer**
**↓**
**Configuration Layer**
**↓**
**Module System Layer**
**↓**
**Language Support Layer**
**↓**
**Core System Layer**
**↓**
**Neovim Core**

##### Component Relationships

Key interactions:
- Core system's interaction with Neovim
- Configuration inheritance (base → user)
- Language server protocol flows
- Plugin management system
- Debug adapter protocol flows

##### Special Features to Highlight

- Snapshot system (.snapshots directory)
- Hydra key binding system
- LSP/DAP auto-installation mechanism
- Project-specific settings
- Theme management

##### Implementation Details

a) Core Systems:
**┌─ Core System ─────────────┐**
- Global State           │
- Lazy Plugin Manager    │
- Core Functions         │
- ┘

b) Configuration Management:
**┌─ Config Layer ──────────┐**
- ┌─ Base Config ───────┐ │
- Options          │ │
- Keymaps         │ │
- UI Settings     │ │
- ┘ │
- ┌─ User Config ────┐  │
- Overrides     │  │
- Custom Settings│  │
- ┘   │
- ┘

c) Language Support:
**┌─ Language Layer ────────┐**
- LSP Servers          │
- Debug Adapters       │
- Formatters          │
- Linters             │
- ┘

##### Important Connections

- Data flow between components
- Inheritance relationships
- Plugin dependencies
- Configuration override paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        UI_COMP["UI Components"]:::ui
        HYDRA["Hydra Keybindings"]:::ui
        THEME["Theme Management"]:::ui
    end

    subgraph CONFIG["Configuration Layer"]
        BASE_CONFIG["Base Configurations"]:::config
        USER_CONFIG["User Configurations"]:::config
        BASE_KEYS["Base Keymaps"]:::config
        USER_KEYS["User Keymaps"]:::config
    end

    subgraph MODULES["Module System Layer"]
        BASE_MOD["Base Modules"]:::module
        USER_MOD["User Modules"]:::module
        COMP_CONFIG["Completion Config"]:::module
        EDITOR_CONFIG["Editor Config"]:::module
        UI_CONFIG["UI Config"]:::module
    end

    subgraph LANG["Language Support Layer"]
        LANG_MGR["Language Management"]:::lang
        LSP_MGR["LSP Manager"]:::lang
        DIAG["Diagnostics Setup"]:::lang
        BASE_LANG["Base Language Configs"]:::lang
        USER_LANG["User Language Configs"]:::lang
        FORMATTERS["Formatter Configs"]:::lang
    end

    subgraph CORE["Core System Layer"]
        CORE_INIT["Core Management"]:::core
        PLUGIN_MGR["Plugin Management"]:::core
        GLOBAL_FUNC["Global Functions"]:::core
        GLOBAL_VAR["Global Variables"]:::core
    end

    NEOVIM["Neovim Core"]:::neovim

    %% Special Features
    SNAPSHOT["Snapshots"]:::special
    CODE_RUNNER["Code Runner"]:::special
    SNIPPETS["Snippets"]:::special

    %% Relationships
    UI --> CONFIG
    CONFIG --> MODULES
    MODULES --> LANG
    LANG --> CORE
    CORE --> NEOVIM

    BASE_CONFIG --> USER_CONFIG
    BASE_KEYS --> USER_KEYS
    BASE_MOD --> USER_MOD
    BASE_LANG --> USER_LANG

    %% Click Events
    click CORE_INIT "https://github.com/stonelukas/lvim-ide/blob/production/lua/core/init.lua"
    click PLUGIN_MGR "https://github.com/stonelukas/lvim-ide/blob/production/lua/core/lazy.lua"
    click GLOBAL_FUNC "https://github.com/stonelukas/lvim-ide/blob/production/lua/core/funcs.lua"
    click GLOBAL_VAR "https://github.com/stonelukas/lvim-ide/blob/production/lua/core/global.lua"
    click BASE_CONFIG "https://github.com/stonelukas/lvim-ide/blob/production/lua/configs/base/init.lua"
    click USER_CONFIG "https://github.com/stonelukas/lvim-ide/blob/production/lua/configs/user/init.lua"
    click BASE_KEYS "https://github.com/stonelukas/lvim-ide/blob/production/lua/configs/base/keymaps.lua"
    click USER_KEYS "https://github.com/stonelukas/lvim-ide/blob/production/lua/configs/user/keymaps.lua"
    click UI_COMP "https://github.com/stonelukas/lvim-ide/tree/production/lua/configs/base/ui"
    click LANG_MGR "https://github.com/stonelukas/lvim-ide/blob/production/lua/languages/init.lua"
    click LSP_MGR "https://github.com/stonelukas/lvim-ide/blob/production/lua/languages/utils/lsp_manager.lua"
    click DIAG "https://github.com/stonelukas/lvim-ide/blob/production/lua/languages/utils/setup_diagnostics.lua"
    click BASE_LANG "https://github.com/stonelukas/lvim-ide/tree/production/lua/languages/base/languages"
    click USER_LANG "https://github.com/stonelukas/lvim-ide/tree/production/lua/languages/user/languages"
    click FORMATTERS "https://github.com/stonelukas/lvim-ide/tree/production/.configs/formatters"
    click BASE_MOD "https://github.com/stonelukas/lvim-ide/tree/production/lua/modules/base"
    click USER_MOD "https://github.com/stonelukas/lvim-ide/tree/production/lua/modules/user"
    click COMP_CONFIG "https://github.com/stonelukas/lvim-ide/tree/production/lua/modules/base/configs/completion"
    click EDITOR_CONFIG "https://github.com/stonelukas/lvim-ide/tree/production/lua/modules/base/configs/editor"
    click UI_CONFIG "https://github.com/stonelukas/lvim-ide/tree/production/lua/modules/base/configs/ui"
    click SNAPSHOT "https://github.com/stonelukas/lvim-ide/blob/production/.snapshots"
    click HYDRA "https://github.com/stonelukas/lvim-ide/tree/production/lua/modules/base/configs/ui/hydra"
    click CODE_RUNNER "https://github.com/stonelukas/lvim-ide/tree/production/.configs/code_runner"
    click SNIPPETS "https://github.com/stonelukas/lvim-ide/tree/production/snippets"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef config fill:#FFC107,stroke:#FFA000,color:black
    classDef module fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef lang fill:#FF5722,stroke:#E64A19,color:white
    classDef ui fill:#4CAF50,stroke:#388E3C,color:white
    classDef special fill:#795548,stroke:#5D4037,color:white
    classDef neovim fill:#607D8B,stroke:#455A64,color:white
```
