# comeza/nvim architecture

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

- Interactive diagram: https://gitdiagram.com/comeza/nvim
- Repository: https://github.com/comeza/nvim

## Overview

##### Configuration Layer (Inner Ring)
- lazy.lua (package manager)
- options.lua (editor settings)
- keymap.lua (key bindings)
- neovide.lua (GUI settings)

##### Plugin Management Layer (Outer Ring)
- Create clusters for related plugins in /lua/plugins/:
- UI/UX Cluster (alpha.lua, lualine.lua, nvimtree.lua, zen.lua, noice.lua)
- LSP Cluster (lsp.lua, mason.lua, cmp.lua)
- Enhancement Cluster (telescope.lua, treesitter.lua, trouble.lua)
- Feature Cluster (instant.lua, obsidian.lua, mini.lua)

##### Utility Layer (Side Component)
- Headers.lua to the core

##### Assets/Resources (Top Layer)
- A section for /headers/ directory
- It to the utils/headers.lua component

Important Elements to Include:

##### Interaction Flows
- Plugin loading sequence through lazy.lua
- Configuration application flow

##### Labels and Notes
- Version information
- Optional dependencies (tree-sitter-cli)
- Installation prerequisites

Special Considerations:

##### Plugin Dependencies
- Relationships between interdependent plugins (e.g., mason and LSP)
- Optional vs. required plugins

##### Configuration Flow
- Lazy-loading nature of the setup
- How different components are initialized

##### Resource Management
- How headers and assets are managed
- Integration points with external tools

## Diagram (Mermaid)

```mermaid
graph TB
    %% Core Layer
    subgraph Core
        NV[Neovim Core]
        INIT["init.lua"]
        click INIT "https://github.com/Comeza/nvim/blob/main/init.lua"
    end

    %% Configuration Layer
    subgraph Config
        LAZY["lazy.lua"]:::config
        OPT["options.lua"]:::config
        KEY["keymap.lua"]:::config
        ICO["icons.lua"]:::config
        NEO["neovide.lua"]:::config
        click LAZY "https://github.com/Comeza/nvim/blob/main/lua/config/lazy.lua"
        click OPT "https://github.com/Comeza/nvim/blob/main/lua/config/options.lua"
        click KEY "https://github.com/Comeza/nvim/blob/main/lua/config/keymap.lua"
        click ICO "https://github.com/Comeza/nvim/blob/main/lua/config/icons.lua"
        click NEO "https://github.com/Comeza/nvim/blob/main/lua/config/neovide.lua"
    end

    %% UI/UX Plugin Cluster
    subgraph UI
        ALPHA["alpha.lua"]:::plugin
        LUALINE["lualine.lua"]:::plugin
        NVIMTREE["nvimtree.lua"]:::plugin
        ZEN["zen.lua"]:::plugin
        NOICE["noice.lua"]:::plugin
        click ALPHA "https://github.com/Comeza/nvim/blob/main/lua/plugins/alpha.lua"
        click LUALINE "https://github.com/Comeza/nvim/blob/main/lua/plugins/lualine.lua"
        click NVIMTREE "https://github.com/Comeza/nvim/blob/main/lua/plugins/nvimtree.lua"
        click ZEN "https://github.com/Comeza/nvim/blob/main/lua/plugins/zen.lua"
        click NOICE "https://github.com/Comeza/nvim/blob/main/lua/plugins/noice.lua"
    end

    %% LSP Plugin Cluster
    subgraph LSP
        LSPCONF["lsp.lua"]:::plugin
        MASON["mason.lua"]:::plugin
        CMP["cmp.lua"]:::plugin
        click LSPCONF "https://github.com/Comeza/nvim/blob/main/lua/plugins/lsp.lua"
        click MASON "https://github.com/Comeza/nvim/blob/main/lua/plugins/mason.lua"
        click CMP "https://github.com/Comeza/nvim/blob/main/lua/plugins/cmp.lua"
    end

    %% Enhancement Plugin Cluster
    subgraph Enhancements
        TELE["telescope.lua"]:::plugin
        TREE["treesitter.lua"]:::plugin
        TROUBLE["trouble.lua"]:::plugin
        click TELE "https://github.com/Comeza/nvim/blob/main/lua/plugins/telescope.lua"
        click TREE "https://github.com/Comeza/nvim/blob/main/lua/plugins/treesitter.lua"
        click TROUBLE "https://github.com/Comeza/nvim/blob/main/lua/plugins/trouble.lua"
    end

    %% Feature Plugin Cluster
    subgraph Features
        INST["instant.lua"]:::plugin
        OBS["obsidian.lua"]:::plugin
        MINI["mini.lua"]:::plugin
        click INST "https://github.com/Comeza/nvim/blob/main/lua/plugins/instant.lua"
        click OBS "https://github.com/Comeza/nvim/blob/main/lua/plugins/obsidian.lua"
        click MINI "https://github.com/Comeza/nvim/blob/main/lua/plugins/mini.lua"
    end

    %% Utility Layer
    subgraph Utils
        HEAD["headers.lua"]:::util
        click HEAD "https://github.com/Comeza/nvim/blob/main/lua/utils/headers.lua"
    end

    %% Assets Layer
    subgraph Assets
        HDR["Headers"]:::asset
        click HDR "https://github.com/Comeza/nvim/tree/main/headers"
    end

    %% Connections
    INIT --> NV
    NV --> LAZY
    LAZY --> UI
    LAZY --> LSP
    LAZY --> Enhancements
    LAZY --> Features
    
    OPT --> NV
    KEY --> NV
    ICO --> NV
    NEO --> NV
    
    HEAD --> NV
    HDR --> HEAD

    MASON --> LSPCONF
    CMP --> LSPCONF

    %% Styles
    classDef core fill:#2b4f81
    classDef config fill:#4b6bab
    classDef plugin fill:#3c8f5d
    classDef util fill:#bf8f30
    classDef asset fill:#808080

    %% Legend
    subgraph Legend
        L1[Core]:::core
        L2[Config]:::config
        L3[Plugin]:::plugin
        L4[Utility]:::util
        L5[Asset]:::asset
    end
```
