# trgianghuynh1808/eri-lazyvim-starter architecture

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

- Interactive diagram: https://gitdiagram.com/trgianghuynh1808/eri-lazyvim-starter
- Repository: https://github.com/trgianghuynh1808/eri-lazyvim-starter

## Overview

##### Main Components
- Neovim Core Config: At the root of the project lies the “nvim” folder that holds the essential configuration files (e.g., init.lua, lazy-lock.json, lazyvim.json). This acts as the bootstrap for Neovim.
- Configuration Settings: Under “nvim/lua/config”, configurations for autocmds, keymaps, lazy loading, and general options are defined. These represent the customization logic for the editor behavior.
- Plugin Management: The “nvim/lua/plugins” directory contains separate Lua files for different groupings of plugins such as coding enhancements, colorschemes, databases, LSP configuration, treesitter integration, and UI improvements.
- Custom Extensions: The “nvim/lua/craftzdog” directory includes additional modules (e.g., discipline.lua) that extend or modify the default behavior, such as handling key spam or editor discipline features.

##### Relationships and Interactions
- The Neovim Core Config initializes the environment and loads all subsequent configuration and plugin files.
- The “config” folder supplies the settings and mappings that control how Neovim reacts to events, user input, and plugin integrations.
- The “plugins” folder dictates which external plugins are leveraged – each Lua file here corresponds to a specific set of functionalities (e.g., LSP, UI, database integration) that are loaded by the core config.
- The custom “craftzdog” module is referenced in the plugin configuration (e.g., in the coding plugins section) to apply specific behaviors.
- External dependencies and tools (such as ripgrep, fd, and Nerd Fonts as mentioned in the README) act as supplementary services aiding the plugins’ functioning, particularly for search functionalities and display aspects.

##### Architectural Patterns and Design Principles
- Modular Design: The configuration is broken into distinct modules (config, plugins, custom scripts) which encourages separation of concerns and ease of maintenance.
- Lazy Loading: Notice the “lazy-lock.json” and “lazyvim.json” files; these indicate that plugins are loaded on demand to optimize performance.
- Customizability and Extensibility: By placing configuration files and plugin setups in different directories, the project allows users to easily add or modify components without affecting the entire system.

##### Important Technologies and Frameworks
- Neovim (version 0.9.0 or higher) is the primary runtime.
- LazyVim for plugin management.
- Lua as the scripting and configuration language.
- External tools/software: ripgrep, fd, and Nerd Font, which support search and display functionalities.
- A range of plugins such as “inc-rename.nvim”, “Comment.nvim”, “copilot.vim”, “mason.nvim”, “nvim-treesitter”, “bufferline.nvim”, and database management plugins that are configured through the project.

##### Final Elements
- Labels for each component and directory (e.g., “nvim/lua/config”, “nvim/lua/plugins/lsp.lua”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Neovim Core Config"
        CoreInit["init.lua"]:::core
        CoreLock["lazy-lock.json"]:::core
        CoreVim["lazyvim.json"]:::core
    end

    subgraph "Configuration Settings"
        ConfigAuto["autocmds.lua"]:::config
        ConfigKey["keymaps.lua"]:::config
        ConfigLazy["lazy.lua"]:::config
        ConfigOpt["options.lua"]:::config
    end

    subgraph "Plugin Management"
        PluginCoding(("coding.lua")):::plugin
        PluginColorscheme(("colorscheme.lua")):::plugin
        PluginDB(("db.lua")):::plugin
        PluginLSP(("lsp.lua")):::plugin
        PluginTreesitter(("treesitter.lua")):::plugin
        PluginUI(("ui.lua")):::plugin
    end

    subgraph "Custom Extensions"
        CustomDiscipline["discipline.lua"]:::custom
    end

    ExtTools{"External Tools\n(ripgrep, fd, Nerd Fonts)"}:::external

    %% Initialization Flow from Neovim Core Config
    CoreInit -->|"loads"| ConfigAuto
    CoreInit -->|"loads"| PluginCoding
    CoreInit -->|"loads"| ConfigKey
    CoreInit -->|"loads"| ConfigLazy
    CoreInit -->|"loads"| ConfigOpt
    CoreInit -->|"loads"| PluginColorscheme
    CoreInit -->|"loads"| PluginDB
    CoreInit -->|"loads"| PluginLSP
    CoreInit -->|"loads"| PluginTreesitter
    CoreInit -->|"loads"| PluginUI

    %% Plugin interactions and extensions
    PluginCoding -->|"uses"| CustomDiscipline

    %% External Tools support for plugin functionalities
    PluginUI -->|"aids"| ExtTools
    PluginLSP -->|"integrates"| ExtTools

    %% Class Definitions
    classDef core fill:#A3E4D7,stroke:#145A32,stroke-width:2px;
    classDef config fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef plugin fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef custom fill:#F5CBA7,stroke:#A04000,stroke-width:2px;
    classDef external fill:#D6EAF8,stroke:#1B4F72,stroke-width:2px;

    %% Click Events for Neovim Core Config
    click CoreInit "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/init.lua"
    click CoreLock "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lazy-lock.json"
    click CoreVim "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lazyvim.json"

    %% Click Events for Configuration Settings
    click ConfigAuto "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/config/autocmds.lua"
    click ConfigKey "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/config/keymaps.lua"
    click ConfigLazy "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/config/lazy.lua"
    click ConfigOpt "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/config/options.lua"

    %% Click Events for Plugin Management
    click PluginCoding "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/plugins/coding.lua"
    click PluginColorscheme "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/plugins/colorscheme.lua"
    click PluginDB "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/plugins/db.lua"
    click PluginLSP "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/plugins/lsp.lua"
    click PluginTreesitter "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/plugins/treesitter.lua"
    click PluginUI "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/plugins/ui.lua"

    %% Click Event for Custom Extensions
    click CustomDiscipline "https://github.com/trgianghuynh1808/eri-lazyvim-starter/blob/master/nvim/lua/craftzdog/discipline.lua"
```
