# luismateo34/my-nvim architecture

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

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

## Overview

- Neovim Core: This is the host application that loads the configuration.
- Initialization Module: Represented by files like init.lua and other setup scripts that bootstrap the configuration.
- Lua Configuration Directory: Divide this into subcomponents:
- Plugins: Contains plugin configurations (e.g., ale, telescope, treesitter, vim-dadbod integration, among others).
- LSP: Contains configurations and integrations for the Language Server Protocol. Show that this module communicates with external language servers.
- DAP (Debug Adapter Protocol): Contains per-language debugging configurations (for Golang, JavaScript, PHP, Python).
- Completition: Contains integration scripts for code-completion support with language-specific modules (Blade, PHP, etc.).
- Keymaps: Sets up key bindings for various plugins and editor functions, including maps for LSP, DAP, and telescopic navigation.
- Settings: General editor settings, including snippet configurations (UltiSnips), formatting (prettier), and other custom settings.
- After Queries: This component (located in the “after” directory) provides additional queries—likely used by Tree-sitter or other language analysis tools—for languages like Blade, HTML, and PHP.
- External Dependency: PostgreSQL Client. This external service is essential for the vim-dadbod plugin to interact with databases, and should be represented as an external component that the plugin depends on.

- The Neovim Core loads the Initialization Module (init.lua), which in turn loads the Lua directory and its submodules.
- The Completition and After Queries modules interact; completition scripts may rely on the query scripts (for example, for Blade templates) to provide language-sensitive completions.
- Keymaps and Settings modules influence core behavior by customizing how and when various plugins or functionalities (like testing, debugging, or snippet insertion) are triggered.

##### Architectural Patterns & Design Principles
- Modular Design: Each aspect of the editor's functionality (snippets, completition, debugging, LSP, key mappings, etc.) is maintained in separate modules, encouraging separation of concerns.
- Extensibility: The clear separation of plugin configurations and external integrations (such as database and language-server support) makes it easy to extend functionality.
- Declarative Configuration: With Lua scripts and organized directories, the design clearly follows a declarative style for editor setup.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A("Neovim Core"):::core
    B("Initialization Module"):::init
    A -->|"loads"| B

    subgraph "Lua Configuration Directory"
        C("Plugins Module"):::module
        D("LSP Module"):::module
        E("DAP Module"):::module
        F("Completition Module"):::module
        G("Keymaps Module"):::module
        H("Settings Module"):::module
    end
    B -->|"loads"| C
    B -->|"loads"| D
    B -->|"loads"| E
    B -->|"loads"| F
    B -->|"loads"| G
    B -->|"loads"| H

    I("After Queries Module"):::module
    B -->|"loads"| I

    F <-->|"integrates_with"| I

    J("External Language Servers"):::external
    D -->|"communicates"| J

    K("External Debug Adapters"):::external
    E -->|"communicates"| K

    L("External Dependency: PostgreSQL Client"):::external
    C -->|"vim-dadbod_requires"| L

    click A "https://github.com/luismateo34/my-nvim/blob/main/init.lua"
    click B "https://github.com/luismateo34/my-nvim/blob/main/init.lua"
    click C "https://github.com/luismateo34/my-nvim/tree/main/lua/plugins/"
    click D "https://github.com/luismateo34/my-nvim/tree/main/lua/lsp/"
    click E "https://github.com/luismateo34/my-nvim/tree/main/lua/dapconfig/"
    click F "https://github.com/luismateo34/my-nvim/tree/main/lua/completition/"
    click G "https://github.com/luismateo34/my-nvim/tree/main/lua/keymap/"
    click H "https://github.com/luismateo34/my-nvim/tree/main/lua/settings/"
    click I "https://github.com/luismateo34/my-nvim/tree/main/after/queries/"
    click L "https://github.com/luismateo34/my-nvim/blob/main/lua/plugins/database.lua"

    classDef core fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef init fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef module fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef external fill:#fff3cd,stroke:#856404,stroke-width:2px;
```
