# shadinmd/nvim architecture

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

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

## Overview

##### Core Components (Central Layer)
- It to a "Configuration Manager" component (init.lua)

##### Configuration Layers (Surrounding the Core)
Create three main configuration groups:

a. Basic Configuration (Light Blue):
- Options (options.lua)
- Keymaps (keymap.lua)
- Utils (utils.lua)

b. Plugin Management (Green):
- LazyVim (lazyvim.lua) as the plugin manager
- Mason (mason.lua) for LSP/DAP management

Editor Enhancement Plugins:
- Treesitter (treesitter.lua)
- Autopair (autopair.lua)
- Formatter (formatter.lua)
- CMP (cmp.lua) for completion

UI Plugins:
- Theme (theme.lua)
- Lualine (lualine.lua)
- Nvim-tree (nvim-tree.lua)
- Trouble (trouble.lua)

Git Integration:
- Gitsigns (gitsigns.lua)
- Lazygit (lazygit.lua)

Search and Navigation:
- Telescope (telescope.lua)

Development Tools:
- LSP Progress (lsp-progress.lua)
- Markdown Preview (markdown-preview.lua)
- Todo (todo.lua)

##### External Dependencies (Bottom Layer)
- Node.js
- CMake
- FZF
- Ripgrep
- FD
- C Compiler
- Git

##### Plugin management flow
- How LazyVim manages plugin installation and loading
- Plugin dependencies and load order

##### Configuration loading sequence
- Initialization flow from init.lua
- Configuration precedence

##### System requirements
- Minimum Neovim version
- Required external tools
- Optional vs. required dependencies

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Components
    subgraph Core
        NV[Neovim Core]:::core
        CM["Configuration Manager"]:::core
    end
    click CM "https://github.com/shadinmd/nvim/blob/main/init.lua"

    %% Basic Configuration
    subgraph BasicConfig
        OPT["Options"]:::basic
        KEY["Keymaps"]:::basic
        UTL["Utils"]:::basic
    end
    click OPT "https://github.com/shadinmd/nvim/blob/main/lua/options.lua"
    click KEY "https://github.com/shadinmd/nvim/blob/main/lua/keymap.lua"
    click UTL "https://github.com/shadinmd/nvim/blob/main/lua/utils.lua"

    %% Plugin Management
    subgraph PluginMgmt
        LV["LazyVim"]:::plugin_mgmt
        MS["Mason"]:::plugin_mgmt
    end
    click LV "https://github.com/shadinmd/nvim/blob/main/lua/lazyvim.lua"
    click MS "https://github.com/shadinmd/nvim/blob/main/lua/plugins/mason.lua"

    %% Editor Enhancement Plugins
    subgraph EditorPlugins
        TS["Treesitter"]:::editor
        AP["Autopair"]:::editor
        FM["Formatter"]:::editor
        CMP["CMP"]:::editor
    end
    click TS "https://github.com/shadinmd/nvim/blob/main/lua/plugins/treesitter.lua"
    click AP "https://github.com/shadinmd/nvim/blob/main/lua/plugins/autopair.lua"
    click FM "https://github.com/shadinmd/nvim/blob/main/lua/plugins/formatter.lua"
    click CMP "https://github.com/shadinmd/nvim/blob/main/lua/plugins/cmp.lua"

    %% UI Plugins
    subgraph UIPlugins
        TH["Theme"]:::ui
        LL["Lualine"]:::ui
        NT["Nvim-tree"]:::ui
        TR["Trouble"]:::ui
    end
    click TH "https://github.com/shadinmd/nvim/blob/main/lua/plugins/theme.lua"
    click LL "https://github.com/shadinmd/nvim/blob/main/lua/plugins/lualine.lua"
    click NT "https://github.com/shadinmd/nvim/blob/main/lua/plugins/nvim-tree.lua"
    click TR "https://github.com/shadinmd/nvim/blob/main/lua/plugins/trouble.lua"

    %% Git Integration
    subgraph GitPlugins
        GS["Gitsigns"]:::git
        LG["Lazygit"]:::git
    end
    click GS "https://github.com/shadinmd/nvim/blob/main/lua/plugins/gitsigns.lua"
    click LG "https://github.com/shadinmd/nvim/blob/main/lua/plugins/lazygit.lua"

    %% Search and Navigation
    subgraph SearchNav
        TL["Telescope"]:::search
    end
    click TL "https://github.com/shadinmd/nvim/blob/main/lua/plugins/telescope.lua"

    %% Development Tools
    subgraph DevTools
        LP["LSP Progress"]:::dev
        MP["Markdown Preview"]:::dev
        TD["Todo"]:::dev
    end
    click LP "https://github.com/shadinmd/nvim/blob/main/lua/plugins/lsp-progress.lua"
    click MP "https://github.com/shadinmd/nvim/blob/main/lua/plugins/markdown-preview.lua"
    click TD "https://github.com/shadinmd/nvim/blob/main/lua/plugins/todo.lua"

    %% External Dependencies
    subgraph ExternalDeps
        NJS["Node.js"]:::external
        CMK["CMake"]:::external
        FZF["FZF"]:::external
        RG["Ripgrep"]:::external
        FD["FD"]:::external
        CC["C Compiler"]:::external
        GIT["Git"]:::external
    end

    %% Connections
    NV --> CM
    CM --> BasicConfig
    CM --> PluginMgmt
    LV --> EditorPlugins
    LV --> UIPlugins
    LV --> GitPlugins
    LV --> SearchNav
    LV --> DevTools
    MS --> DevTools

    %% External Dependencies
    ExternalDeps --> NV

    %% Styles
    classDef core fill:#2b4c7d,stroke:#1a2f4d,color:white
    classDef basic fill:#5b9bd5,stroke:#2e4e6b,color:white
    classDef plugin_mgmt fill:#70ad47,stroke:#507e32,color:white
    classDef editor fill:#9b6b9e,stroke:#6b4b6e,color:white
    classDef ui fill:#ed7d31,stroke:#b35f24,color:white
    classDef git fill:#ffc000,stroke:#bf9000,color:black
    classDef search fill:#4472c4,stroke:#2f5597,color:white
    classDef dev fill:#c00000,stroke:#900000,color:white
    classDef external fill:#7f7f7f,stroke:#595959,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Basic Configuration]:::basic
        L3[Plugin Management]:::plugin_mgmt
        L4[Editor Plugins]:::editor
        L5[UI Plugins]:::ui
        L6[Git Integration]:::git
        L7[Search & Navigation]:::search
        L8[Development Tools]:::dev
        L9[External Dependencies]:::external
    end
```
