# dev-harsh0218/nvim-lsp-config architecture

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

- Interactive diagram: https://gitdiagram.com/dev-harsh0218/nvim-lsp-config
- Repository: https://github.com/dev-harsh0218/nvim-lsp-config

## Overview

##### Project type and purpose
- This is a Neovim configuration repository written in Lua. It’s designed to bootstrap and configure a set of Neovim plugins focusing on LSP (Language Server Protocol) support, Treesitter syntax parsing, auto-completion, file tree navigation, and fuzzy finding.

##### File structure
- Top level:
- init.lua — the Neovim entry point that initializes the plugin manager and loads configs
- lazy-lock.json — lock file for your lazy plugin manager
- lua/
– config/ — site-specific settings: keymaps.lua, options.lua, registers.lua
– plugins/ — per-plugin specification and setup: autopairs.lua, colorscheme.lua, lsp-config.lua, nvim-cmp.lua, nvim-tree.lua, telescope.lua, treesitter.lua, ts-autotag.lua
- No separate “backend” or “frontend,” but a clear separation between plugin declarations (plugins/) and user preferences (config/).

##### README
- Describes the stacking of Neovim LSP, Treesitter, auto-completion (nvim-cmp), file tree (nvim-tree), and fuzzy finder (telescope).

a. Main components:
- Neovim Core (built-in client)
- Plugin Manager (e.g., lazy.nvim)
- Plugin Modules (each .lua under lua/plugins/)
- User Config Modules (lua/config/)
- External Services: LSP servers, language parsers
b. Relationships/interactions:
- init.lua → invokes Plugin Manager → reads lazy-lock.json + lua/plugins/*
- Plugin Manager loads each plugin at startup
- After a plugin is loaded, its corresponding config module (from lua/config/) is applied
- LSP plugins talk to external LSP servers over RPC
- Treesitter plugin fetches/compiles parser grammars
- nvim-cmp plugin requests completions from the active LSP client and snippet engine
- telescope invokes fuzzy-finder UI over Neovim buffers and file tree
c. Architectural patterns & design principles:
- Modular configuration: each feature in its own file under lua/plugins or lua/config
- Lazy loading: only load plugins or modules when needed (using lazy.nvim)
- Separation of concerns: plugin declaration vs plugin configuration vs user keybindings
d. Key technologies & libraries:
- lazy.nvim (plugin manager)
- nvim-lspconfig (LSP client)
- nvim-cmp (completion engine)
- nvim-treesitter (syntax parsing) + ts-autotag
- telescope.nvim (finder)
- nvim-tree.lua (file explorer)
- autopairs, colorscheme plugins

## Diagram (Mermaid)

```mermaid
flowchart TD
    Init["init.lua"]:::core
    LL["lazy-lock.json"]:::core
    PM["Plugin Manager (lazy.nvim)"]:::core

    Init -->|"bootstraps"| PM
    PM -->|"reads"| LL

    subgraph "Plugin Modules"
        direction TB
        AP["autopairs.lua"]:::plugin
        CS["colorscheme.lua"]:::plugin
        LSPP["lsp-config.lua"]:::plugin
        CMP["nvim-cmp.lua"]:::plugin
        NT["nvim-tree.lua"]:::plugin
        TEL["telescope.lua"]:::plugin
        TS["treesitter.lua"]:::plugin
        TAG["ts-autotag.lua"]:::plugin
    end

    PM -->|"loads"| AP
    PM -->|"loads"| CS
    PM -->|"loads"| LSPP
    PM -->|"loads"| CMP
    PM -->|"loads"| NT
    PM -->|"loads"| TEL
    PM -->|"loads"| TS
    PM -->|"loads"| TAG

    subgraph "User Config Modules"
        direction TB
        KM["keymaps.lua"]:::config
        OP["options.lua"]:::config
        RG["registers.lua"]:::config
    end

    Init -->|"loads configs"| KM
    Init -->|"loads configs"| OP
    Init -->|"loads configs"| RG

    subgraph "External Services"
        direction TB
        LSPServ(("LSP Servers")):::external
        Parsers(("Treesitter Parsers")):::external
    end

    LSPP -->|"RPC"| LSPServ
    CMP -->|"requests completions"| LSPServ
    TS -->|"installs/compiles"| Parsers
    TEL -->|"invokes UI over buffers & file tree"| NT

    click Init "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/init.lua"
    click PM "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/init.lua"
    click LL "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lazy-lock.json"
    click AP "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/autopairs.lua"
    click CS "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/colorscheme.lua"
    click LSPP "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/lsp-config.lua"
    click CMP "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/nvim-cmp.lua"
    click NT "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/nvim-tree.lua"
    click TEL "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/telescope.lua"
    click TS "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/treesitter.lua"
    click TAG "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/plugins/ts-autotag.lua"
    click KM "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/config/keymaps.lua"
    click OP "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/config/options.lua"
    click RG "https://github.com/dev-harsh0218/nvim-lsp-config/blob/master/lua/config/registers.lua"

    classDef core fill:#B3D4FC,stroke:#0366D6,color:#000
    classDef plugin fill:#C8E6C9,stroke:#2E7D32,color:#000
    classDef config fill:#FFF9C4,stroke:#F9A825,color:#000
    classDef external fill:#FFE0B2,stroke:#FB8C00,color:#000
```
