Skip to content

bird-chinese-community/BIRD-tm-language-grammar

Repository files navigation

BIRD2 Configuration Language

Preview

English | 简体中文

TextMate Grammar Vim Syntax

Table of Contents

Introduction

BIRD (BIRD Internet Routing Daemon)
Open-source routing daemon for managing routing tables on network infrastructure.

This repository hosts syntax files (tmLanguage) for BIRD2, designed to enhance developer productivity through syntax highlighting in configuration files.

Unlike the straightforward paradigms of INI or Nginx configurations, BIRD employs a distinctly intricate configuration model with unique implementation challenges.

Why This Project

Despite its role in core internet infrastructure, BIRD2 still lacks native syntax highlighting and formatting support in mainstream editors like VSCode and Shiki.

Network engineers and developers have long relied on workarounds, such as using Nginx or INI syntax modes.

However, these do not accurately represent the complex grammar of BIRD2.

To address this issue, the BIRD Chinese Community has officially open-sourced a TextMate-based syntax grammar for BIRD2. Our goal is to improve developer experience and foster broader ecosystem support.

Try It Live

Editors & IDE Support

VSCode

VSCode Syntax Highlighting Preview

VS Code Marketplace Open VSX Registry

Vim / Neovim

Vim Syntax Highlighting Preview

Note

We recommend using VSCode for the best experience.

Vim/Neovim support has been migrated to dedicated repositories for better maintenance and feature updates.

Dedicated Plugin Repositories:

Installation:

Vim (using vim-plug):

Plug 'bird-chinese-community/BIRD2.vim'

Neovim (using lazy.nvim):

{
  "bird-chinese-community/BIRD2.nvim",
  ft = "bird2",
  config = function()
    require("bird2").setup()
  end
}

Backward Compatibility (still installable from this repo):

  1. Clone this repository: git clone https://github.com/bird-chinese-community/bird-tm-language-grammar.git
  2. Quick install: bash scripts/install.sh (installs Vim and Neovim)
    • Only Neovim: bash scripts/install.sh --neovim
    • Only Vim: bash scripts/install.sh --vim
  3. Open sample/basic.conf and verify highlighting. Optional: use :verbose set ft? to confirm filetype=bird2

Jetbrains (TextMate Bundles)

JetBrains IDEA Syntax Highlighting Preview

Note

We recommend VSCode for the best experience, but JetBrains with TextMate Bundles works well for syntax highlighting.

  1. Prepare the language pack a) Open https://open-vsx.org/extension/BIRDCC/vscode-bird2-conf ▸ Resources (lower right) ▸ Download the latest .vsix package; b) Unzip the .vsix file using any archiver; c) In the unzipped folder, locate the directory containing package.json, keep this path for the next step;
  2. Open IntelliJ IDEA: Settings/Preferences ▸ Editor ▸ TextMate Bundles;
  3. Click ➕ (Add) and select the directory from step 1(c);
  4. Scroll the language list, confirm that bird2 appears and check the box;
  5. Follow prompts to restart the IDE.

Development Workflow

This repository uses Prek as the pre-commit runner.

  1. Install Prek and install hooks:
    • prek install --install-hooks --hook-type pre-commit --hook-type pre-push --hook-type commit-msg
  2. Before/after editing syntax files, run targeted checks:
    • prek run --files grammars/bird2.tmLanguage.json
    • prek run --files external/bird2.vim/syntax/bird2.vim external/bird2.nvim/syntax/bird2.vim
  3. Before pushing or opening a PR, run:
    • prek run --all-files
  4. Bump patch version for tm grammar + Vim/Neovim syntax snapshots:
    • node scripts/bump-version.js --dry-run
    • node scripts/bump-version.js

Project Status

Community Adoption Evidence

GitHub Usage Statistics

Production Deployment at Internet Scale

BIRD2 powers critical internet infrastructure for major operators:

  • AMS-IX (World's largest IXP)
    Handles >870 ASNs with 20k+ IPv4/5k+ IPv6 prefixes at 14Tb/s+ traffic
    Route-Server Platform

  • LINX (London Internet Exchange)
    Migrated 1,000+ peer sessions to BIRD 2.13 across 7 global sites (2024)
    Technology Update

  • Cloudflare Anycast Edge
    Deployed on every server in 280+ PoPs for sub-second failover routing
    Architecture Deep Dive

Contributors

The BIRD Chinese Community extends gratitude to these contributors:

License

About

This repository hosts syntax files (`tmLanguage`) for BIRD2 (bird.conf).

Topics

Resources

License

MPL-2.0, MIT licenses found

Licenses found

MPL-2.0
LICENSE
MIT
LICENSE.sample

Stars

Watchers

Forks

Packages

 
 
 

Contributors