Home

Awesome

vim-ungrammar

Vim-ungrammar is a plugin for Neovim and Vim for the Ungrammar filetype which provides:

Preview

Here is a preview of the syntax highlighting, using nvim-highlite as a theme:

preview

Configuration

Highlighting Groups

This plugin defines the following syntax groups:

Group NameDescriptionExample
ungramAlternationAn alternation on a rule.|
ungramConditionalGroupA group which is a conditional.(Foo|Bar)?
ungramConditionalStringA conditional ungramString.'for'?
ungramConditionalA conditional (1-or-0).?
ungramLabelA label for a token or string.scope:'local'
ungramOperatorAn operator.=
ungramOrAlternative for a given position.Foo|Bar
ungramQuoteA quote for a string or token.'
ungramRepeatGroupA group which is repeated.(Foo|Bar)*
ungramRepeatStringA repeated ungramString.'for'*
ungramRepeat0 or more repetitions.*
ungramRuleA rule for a grammar.Foo
ungramStringA specific string of characters.'for'
ungramTokenA token.'identifier_var'

Markdown Integration

You can use this plugin seamlessly with plasticboy/vim-markdown provided that the following is part of your init.vim configuration:

let g:vim_markdown_fenced_languages = ['ungram=ungrammar']

Then, you can create codeblocks in markdown and it will use the syntax file from this plugin:

	```ungram
	 Foo = 'A' | 'B'

Credits