# mawkler/nvim architecture

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

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

## Overview

##### Configuration Layer (First Ring)
a. Basic Settings (init.lua, options.lua)
b. Key Mappings (keymaps.lua)
c. Auto Commands (autocmds.lua)
d. Commands (commands.lua)

##### Plugin Management Layer
- Lazy.nvim as the plugin manager
- It to both the core and the plugin layers
- Utils/lazy.lua as the configuration bridge

##### Feature Clusters (Outer Ring)
Plugins into functional groups:

a. UI/UX Enhancement Cluster:
- Theme Management (catppuccin.lua, onedark.lua)
- Status Line (feline.lua, statusline.lua)
- File Navigation (nvim-tree.lua, oil.lua)
- Visual Aids (indent-blankline, colorizer)

b. Development Tools Cluster:
- LSP Configuration (lsp.lua)
- Completion (cmp.lua)
- Debugging (dap.lua, dap-ui.lua)
- Git Integration (gitsigns.lua, neogit.lua)

c. Language Support Cluster:
- TreeSitter (treesitter folder)
- Language-specific configs (rust.lua, go.lua, typescript.lua)
- Snippets (snippets directory)

d. Editor Enhancement Cluster:
- Search/Navigation (telescope.lua, fzf.lua)
- Text Manipulation (surround.lua, comment.lua)
- Window Management (smart-splits.lua, windows.lua)

##### Utility Layer (Outer Edge)
- Utility modules (utils directory)
- Them to relevant components

##### Relationship between
- LSP configurations and language-specific settings
- TreeSitter and syntax highlighting
- Custom commands and their related plugins

##### A small section showing external dependencies
- Python support (neovim Python module)
- System requirements
- Optional external tools

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core
    subgraph Core
        NVCore[Neovim Core]:::core
    end

    %% Configuration Layer
    subgraph ConfigLayer["Configuration Layer"]
        BasicSettings["Basic Settings"]:::config
        KeyMaps["Key Mappings"]:::config
        AutoCmds["Auto Commands"]:::config
        Commands["Commands"]:::config
    end

    %% Plugin Management
    subgraph PluginMgmt["Plugin Management"]
        LazyNvim["lazy.nvim"]:::plugin
        LazyUtil["Lazy Utils"]:::util
    end

    %% UI/UX Enhancement
    subgraph UIUX["UI/UX Enhancement"]
        direction TB
        subgraph Themes
            Catppuccin["Catppuccin"]:::ui
            OneDark["OneDark"]:::ui
        end
        subgraph StatusLine
            Feline["Feline"]:::ui
            StatusLine["Status Line"]:::ui
        end
        subgraph FileNav
            NvimTree["Nvim Tree"]:::ui
            Oil["Oil"]:::ui
        end
        subgraph VisualAids
            IndentLine["Indent Blankline"]:::ui
            Colorizer["Colorizer"]:::ui
        end
    end

    %% Development Tools
    subgraph DevTools["Development Tools"]
        direction TB
        LSPConfig["LSP Config"]:::dev
        Completion["CMP"]:::dev
        subgraph Debug
            DAP["DAP"]:::dev
            DAPUI["DAP UI"]:::dev
        end
        subgraph Git
            GitSigns["Git Signs"]:::dev
            NeoGit["Neo Git"]:::dev
        end
    end

    %% Language Support
    subgraph LangSupport["Language Support"]
        direction TB
        TreeSitter["TreeSitter"]:::lang
        subgraph LangConfigs
            Rust["Rust"]:::lang
            Go["Go"]:::lang
            TypeScript["TypeScript"]:::lang
        end
        Snippets["Snippets"]:::lang
    end

    %% Editor Enhancement
    subgraph EditorEnh["Editor Enhancement"]
        direction TB
        subgraph Search
            Telescope["Telescope"]:::editor
            FZF["FZF"]:::editor
        end
        subgraph TextManip
            Surround["Surround"]:::editor
            Comment["Comment"]:::editor
        end
        subgraph WinMgmt
            SmartSplits["Smart Splits"]:::editor
            Windows["Windows"]:::editor
        end
    end

    %% Utility Layer
    subgraph Utils["Utility Layer"]
        ColorUtils["Color Utils"]:::util
        Icons["Icons"]:::util
    end

    %% Connections
    NVCore --> ConfigLayer
    NVCore --> LazyNvim
    LazyNvim --> LazyUtil
    LazyNvim --> UIUX
    LazyNvim --> DevTools
    LazyNvim --> LangSupport
    LazyNvim --> EditorEnh
    Utils --> UIUX
    Utils --> DevTools
    LSPConfig --> LangConfigs

    %% Styles
    classDef core fill:#2b4182
    classDef config fill:#6b9ac4
    classDef plugin fill:#4a5568
    classDef ui fill:#48bb78
    classDef dev fill:#ed8936
    classDef lang fill:#9f7aea
    classDef editor fill:#ecc94b
    classDef util fill:#718096

    %% Click Events
    click BasicSettings "https://github.com/mawkler/nvim/blob/master/lua/configs/options.lua"
    click KeyMaps "https://github.com/mawkler/nvim/blob/master/lua/configs/keymaps.lua"
    click AutoCmds "https://github.com/mawkler/nvim/blob/master/lua/configs/autocmds.lua"
    click Commands "https://github.com/mawkler/nvim/blob/master/lua/configs/commands.lua"
    click LazyUtil "https://github.com/mawkler/nvim/blob/master/lua/utils/lazy.lua"
    click Catppuccin "https://github.com/mawkler/nvim/blob/master/lua/configs/catppuccin.lua"
    click OneDark "https://github.com/mawkler/nvim/blob/master/lua/configs/onedark.lua"
    click Feline "https://github.com/mawkler/nvim/blob/master/lua/configs/feline.lua"
    click StatusLine "https://github.com/mawkler/nvim/blob/master/lua/statusline.lua"
    click NvimTree "https://github.com/mawkler/nvim/blob/master/lua/configs/nvim-tree.lua"
    click Oil "https://github.com/mawkler/nvim/blob/master/lua/configs/oil.lua"
    click IndentLine "https://github.com/mawkler/nvim/tree/master/lua/configs/indent-blankline/"
    click Colorizer "https://github.com/mawkler/nvim/blob/master/lua/configs/nvim-colorizer.lua"
    click LSPConfig "https://github.com/mawkler/nvim/blob/master/lua/configs/lsp.lua"
    click Completion "https://github.com/mawkler/nvim/blob/master/lua/configs/cmp.lua"
    click DAP "https://github.com/mawkler/nvim/blob/master/lua/configs/dap.lua"
    click DAPUI "https://github.com/mawkler/nvim/blob/master/lua/configs/dap-ui.lua"
    click GitSigns "https://github.com/mawkler/nvim/blob/master/lua/configs/gitsigns.lua"
    click NeoGit "https://github.com/mawkler/nvim/blob/master/lua/configs/neogit.lua"
    click TreeSitter "https://github.com/mawkler/nvim/tree/master/lua/configs/treesitter/"
    click Rust "https://github.com/mawkler/nvim/blob/master/lua/configs/rustaceanvim.lua"
    click Go "https://github.com/mawkler/nvim/blob/master/lua/configs/go.lua"
    click TypeScript "https://github.com/mawkler/nvim/blob/master/lua/configs/typescript.lua"
    click Snippets "https://github.com/mawkler/nvim/tree/master/snippets/"
    click Telescope "https://github.com/mawkler/nvim/blob/master/lua/configs/telescope.lua"
    click FZF "https://github.com/mawkler/nvim/blob/master/lua/configs/fzf.lua"
    click Surround "https://github.com/mawkler/nvim/blob/master/lua/configs/surround.lua"
    click Comment "https://github.com/mawkler/nvim/blob/master/lua/configs/comment.lua"
    click SmartSplits "https://github.com/mawkler/nvim/blob/master/lua/configs/smart-splits.lua"
    click Windows "https://github.com/mawkler/nvim/blob/master/lua/configs/windows.lua"
    click ColorUtils "https://github.com/mawkler/nvim/blob/master/lua/utils/colors.lua"
    click Icons "https://github.com/mawkler/nvim/blob/master/lua/utils/icons.lua"
```
