Skip to content

NeoVim semantic syntax highlighting and completion plugin for BNF grammar

License

Notifications You must be signed in to change notification settings

daskol/nvim-bnf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nvim-BNF

NeoVim semantic syntax highlighting plugin for BNF grammar

Overview

nvim-bnf is a remote NeoVim plugin which provides both syntactical and semantical highlighting and autocompletion based on NCM2 for grammars written in Backus-Naur form (BNF). The plugin is written in Golang and governs MsgPack RPC protocol according to NeoVim specification. So there is only a little hunk of code written in VimL which performs registration and bootstrapping the plugin.

Vim cast demo

Installation

In order to install one could use his or her favourite plugin manager like Plug. Surely, Golang workspace must be set up before. It could look something like on the following code snippet.

    call plug#begin('~/.config/nvim/plugged')
        Plug 'daskol/nvim-bnf', { 'do': 'go install ./cmd/nvim-nbf' }
    call plug#end()

Development

NeoVim requires manifest for remote plugins. There is no reason to write it manually since the plugin provides ability to generate manifest as follows.

    $ ./nvim-bnf --gen-manifest
    call remote#host#RegisterPlugin('nvim-bnf', '0', [
    \ {'type': 'autocmd', 'name': 'BufNewFile', ... },
    \ {'type': 'autocmd', 'name': 'BufRead', ... },
    \ ])