# mustache/vim-mustache-handlebars architecture

> Architecture diagram of the GitHub repository mustache/vim-mustache-handlebars, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mustache/vim-mustache-handlebars
- Repository: https://github.com/mustache/vim-mustache-handlebars

## Overview

This is a Vim editing plugin for Mustache and Handlebars templates. Its user-facing workflow is editing a template in Vim with syntax highlighting and optional or default editing aids: abbreviations, section motions, text objects, and matchit support. The tree also contains filetype detection and indentation scripts. No source excerpts were provided, so the graph includes only README-documented feature relationships; it does not infer calls between runtime scripts.

Main entry points: [`ftdetect/mustache.vim`](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftdetect/mustache.vim) (Mustache detection), [`ftdetect/handlebars.vim`](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftdetect/handlebars.vim) (Handlebars detection), [`ftplugin/mustache.vim`](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftplugin/mustache.vim) (Mustache editing aids), [`ftplugin/handlebars.vim`](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftplugin/handlebars.vim) (Handlebars editing aids)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_detection["Filetype detection"]
  node_mustache_detect["Mustache detection<br/>[mustache.vim]"]
  node_handlebars_detect["Handlebars detection<br/>[handlebars.vim]"]
end

subgraph group_editing["Editing support"]
  node_mustache_editing["Mustache editing aids<br/>[mustache.vim]"]
  node_handlebars_editing["Handlebars editing aids<br/>[handlebars.vim]"]
  node_mustache_indent["Mustache indentation<br/>[mustache.vim]"]
  node_handlebars_indent["Handlebars indentation<br/>[handlebars.vim]"]
end

subgraph group_presentation["Template presentation"]
  node_mustache_syntax["Mustache syntax<br/>[mustache.vim]"]
  node_handlebars_syntax["Handlebars syntax<br/>[handlebars.vim]"]
end

node_vim(("Vim editor"))

node_vim -->|"detects templates"| node_mustache_detect
node_vim -->|"detects templates"| node_handlebars_detect
node_vim -->|"highlights syntax"| node_mustache_syntax
node_vim -->|"highlights syntax"| node_handlebars_syntax
node_vim -->|"provides editing aids"| node_mustache_editing
node_vim -->|"provides editing aids"| node_handlebars_editing

click node_mustache_detect "https://github.com/mustache/vim-mustache-handlebars/blob/master/ftdetect/mustache.vim"
click node_handlebars_detect "https://github.com/mustache/vim-mustache-handlebars/blob/master/ftdetect/handlebars.vim"
click node_mustache_syntax "https://github.com/mustache/vim-mustache-handlebars/blob/master/syntax/mustache.vim"
click node_handlebars_syntax "https://github.com/mustache/vim-mustache-handlebars/blob/master/syntax/handlebars.vim"
click node_mustache_editing "https://github.com/mustache/vim-mustache-handlebars/blob/master/ftplugin/mustache.vim"
click node_handlebars_editing "https://github.com/mustache/vim-mustache-handlebars/blob/master/ftplugin/handlebars.vim"
click node_mustache_indent "https://github.com/mustache/vim-mustache-handlebars/blob/master/indent/mustache.vim"
click node_handlebars_indent "https://github.com/mustache/vim-mustache-handlebars/blob/master/indent/handlebars.vim"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mustache_detect,node_handlebars_detect toneBlue
class node_mustache_editing,node_handlebars_editing,node_mustache_indent,node_handlebars_indent toneAmber
class node_mustache_syntax,node_handlebars_syntax toneMint
class node_vim toneIndigo
```

## Components

### Filetype detection

- [Mustache detection](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftdetect/mustache.vim): `ftdetect/mustache.vim`
- [Handlebars detection](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftdetect/handlebars.vim): `ftdetect/handlebars.vim`

### Editing support

- [Mustache editing aids](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftplugin/mustache.vim): `ftplugin/mustache.vim`
- [Handlebars editing aids](https://github.com/mustache/vim-mustache-handlebars/blob/master/ftplugin/handlebars.vim): `ftplugin/handlebars.vim`
- [Mustache indentation](https://github.com/mustache/vim-mustache-handlebars/blob/master/indent/mustache.vim): `indent/mustache.vim`
- [Handlebars indentation](https://github.com/mustache/vim-mustache-handlebars/blob/master/indent/handlebars.vim): `indent/handlebars.vim`

### Template presentation

- [Mustache syntax](https://github.com/mustache/vim-mustache-handlebars/blob/master/syntax/mustache.vim): `syntax/mustache.vim`
- [Handlebars syntax](https://github.com/mustache/vim-mustache-handlebars/blob/master/syntax/handlebars.vim): `syntax/handlebars.vim`

### Other components

- **Vim editor**

## Connections

- Vim editor → Mustache detection: detects templates (evidence: `README.md`)
- Vim editor → Handlebars detection: detects templates (evidence: `README.md`)
- Vim editor → Mustache syntax: highlights syntax (evidence: `README.md`)
- Vim editor → Handlebars syntax: highlights syntax (evidence: `README.md`)
- Vim editor → Mustache editing aids: provides editing aids (evidence: `README.md`)
- Vim editor → Handlebars editing aids: provides editing aids (evidence: `README.md`)
