# curtkim/nvim-from-scratch architecture

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

- Interactive diagram: https://gitdiagram.com/curtkim/nvim-from-scratch
- Repository: https://github.com/curtkim/nvim-from-scratch

## Overview

##### Project’s Main Components
- Neovim Core / Entry Point – Represented by the init.lua file at the root. This is the entry point which loads the configuration.
- Configuration Modules – Found under the lua/config directory. These modules include keymaps.lua (handling keyboard shortcuts), lazy.lua (likely managing lazy.nvim setup), and options.lua (editor settings).
- Plugin Configuration – Gathered inside the lua/plugins folder. Each file here sets up a different plugin (e.g., blink-cmp, lsp, which-key, etc.). This clearly separates individual plugin configurations rather than a monolithic config.
- External/Temporary Code – The tmp directory includes test files (hello_world.lua and hello_world.sh) along with a Rust “hello_world” project. Although not part of the configuration per se, they may serve as sample or experimental code illustrating interoperability or testing procedures.

##### Relationships and Interactions
- The lazy-lock.json and lazy.lua indicate that lazy.nvim (a plugin manager) is used to orchestrate the downloading, versioning, and handling of plugins. Thus, add an external “Plugin Manager (lazy.nvim)” component that the plugins module communicates with.

##### Architectural Patterns and Principles
- Extensibility: With plugin-specific configuration files, it is straightforward to add or remove plugins without affecting the rest of the config. Indicate that each plugin file is a plug-in component that can be individually modified.

##### Technologies & Frameworks
- Neovim – the underlying text editor.
- Lua – the scripting language used for the configuration.
- lazy.nvim – the plugin manager which is central to how plugins are handled in this setup.
- Additional plugins – like lsp for language server protocol support, treesitter for syntax parsing, which-key for keybinding hints, etc.
- (Optional) Rust – In the temporary directory, indicating an example external or experimental project integration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Core Startup"
        initCore["Neovim Core (init.lua)"]
    end

    subgraph "Configuration Modules"
        Config_Keymaps["Keymaps (lua/config/keymaps.lua)"]
        Config_Lazy["Lazy Setup (lua/config/lazy.lua)"]
        Config_Options["Options (lua/config/options.lua)"]
    end

    subgraph "Plugin Configurations"
        Plugins["Plugin Files (lua/plugins)"]
    end

    PluginManager["Plugin Manager (lazy.nvim)"]
    ExternalRepo["External Plugin Repository"]

    subgraph "Sandbox/Test Environment"
        Sandbox["Temporary/Test Files (tmp)"]
    end

    %% Connections
    initCore -->|"loads"| Config_Keymaps
    initCore -->|"loads"| Config_Lazy
    initCore -->|"loads"| Config_Options
    initCore -->|"loads"| Plugins
    Config_Lazy -->|"configures"| PluginManager
    Plugins -->|"coordinated-by"| PluginManager
    PluginManager -->|"syncs with"| ExternalRepo
    initCore ---|"optional"| Sandbox

    %% Click Events
    click initCore "https://github.com/curtkim/nvim-from-scratch/blob/main/init.lua"
    click Config_Keymaps "https://github.com/curtkim/nvim-from-scratch/blob/main/lua/config/keymaps.lua"
    click Config_Lazy "https://github.com/curtkim/nvim-from-scratch/blob/main/lua/config/lazy.lua"
    click Config_Options "https://github.com/curtkim/nvim-from-scratch/blob/main/lua/config/options.lua"
    click Plugins "https://github.com/curtkim/nvim-from-scratch/tree/main/lua/plugins"
    click Sandbox "https://github.com/curtkim/nvim-from-scratch/tree/main/tmp"

    %% Styles
    classDef core fill:#ffcccb,stroke:#333,stroke-width:2px;
    classDef config fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef plugin fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef sandbox fill:#ffff99,stroke:#333,stroke-width:2px;
    classDef external fill:#d3d3d3,stroke:#333,stroke-width:2px,stroke-dasharray:5 5;

    class initCore core;
    class Config_Keymaps,Config_Lazy,Config_Options config;
    class Plugins,PluginManager plugin;
    class Sandbox sandbox;
    class ExternalRepo external;
```
