Last active
March 9, 2024 08:49
-
-
Save Chubek/37fa48239ac0de78da45475d9533b123 to your computer and use it in GitHub Desktop.
Syntax Highlighters for NeoVim/VIm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ebnf.vim - Syntax highlighting for EBNF | |
" Author: Chubak Bidpaa (chubakbidpaa@riseup.net) | |
if exists("b:current_syntax") | |
finish | |
endif | |
syntax region ebnfComment start=/\v#\s+/ end=/\v$/ | |
syntax region ebnfMultiCharTerminal start=/\v"/ end=/\v"/ | |
syntax region ebnfSingleCharTerminal start=/\v'/ end=/\v'/ | |
syntax match ebnfSubsection /\v\+?[a-zA-Z0-9_-]+(::[a-zA-Z0-9_-]+)+/ | |
syntax match ebnfNonTermIdent /\v[-_a-z0-9]+/ | |
syntax match ebnfLhsIdent /\v^[-_a-z0-9]+/ | |
syntax match ebnfOperator "::=" | |
syntax match ebnfOperator "{" | |
syntax match ebnfOperator "}" | |
syntax match ebnfOperator "\[" | |
syntax match ebnfOperator "]" | |
syntax match ebnfOperator "(" | |
syntax match ebnfOperator ")" | |
syntax match ebnfOperator "/" | |
syntax match ebnfOperator "|" | |
syntax match ebnfOperator "\.\.\." | |
syntax match ebnfRegexOperator "?" | |
syntax match ebnfRegexOperator "*" | |
syntax match ebnfRegexOperator "+" | |
highlight link ebnfComment Comment | |
highlight link ebnfMultiCharTerminal String | |
highlight link ebnfSingleCharTerminal Character | |
highlight link ebnfNonTermIdent Identifier | |
highlight link ebnfLhsIdent Underlined | |
highlight link ebnfOperator Operator | |
highlight link ebnfRegexOperator Type | |
highlight link ebnfSubsection Keyword | |
let b:current_syntax = "ebnf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file for Vmgen | |
" Author: Chubak Bidpaa (chubakbidpaa@riseup.net) | |
if exists("b:current_syntax") | |
finish | |
endif | |
syntax include @vmgenCCode syntax/c.vim | |
syntax region vmgenInstructionCode start="\v\w+\s+\([^)]*\-\-[^)]*\)$" end="\n\n" contains=@vmgenCCode,vmgenStackEffect | |
syntax match vmgenComment /^\v\\ \s*.*$/ | |
syntax match vmgenEEscape "^\v\\E \s*.+$" | |
syntax match vmgenCEscape "^\v\\C \s*.+$" | |
syntax match vmgenStackEffect "\v\w+\s+\([^)]*\-\-[^)]*\)$" contained | |
syntax keyword \E \C | |
hi link vmgenStackEffect Operator | |
hi link vmgenComment Comment | |
hi link vmgenEEScape Statement | |
hi link vmgenCEscape Statement | |
let b:current_syntax = "vmgen" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment