Skip to content

Simple Neovim syntax highlighting for BNF (Backus-Naur Form) grammar files

License

Notifications You must be signed in to change notification settings

Adamkleo/bnf-syntax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bnf-syntax.nvim

Simple syntax highlighting for BNF (Backus-Naur Form) grammar files in Neovim.

Demo

BNF Syntax Highlighting

Installation

Lazy.nvim

{
  "adamkleo/bnf-syntax"
}

Packer

use "adamkleo/bnf-syntax"

Usage

The plugin automatically detects .bnf files and applies syntax highlighting. No configuration required.

Example BNF syntax that will be highlighted:

<expression> ::= <term> | <expression> "+" <term>
<term> ::= <factor> | <term> "*" <factor>
<factor> ::= "(" <expression> ")" | <number>

Configuration

Optionally customize the filetype and extension:

require("bnf-syntax").setup({
  filetype = "bnf",
  extension = "bnf"
})

The extension option is used to match files ending with the chosen extension. The filetype option sets the filetype of the matched files. By default, these values are both "bnf"

License

MIT

About

Simple Neovim syntax highlighting for BNF (Backus-Naur Form) grammar files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published