Simple syntax highlighter written in vimscript for the Bminor language. This is a bit too little, too late as the Compilers and Language Design course recently ended a few weeks prior to starting this. I had wanted to make this during the semester to make reading and writing Bminor code a bit easier, but couldn't find the time to work on it. I figured I might as well make it now that I have time over winter break so I can at least learn some more vimscript.
If you use vundle then you can simple install by adding:
Plugin 'ginglis13/bminor-vim-syntax-highlighting'
to your .vimrc
You must have the syntax
and ftdetect
folders in the top level of your ~/.vim/
folder. syntax
defines keywords and regular
expressions to match things like strings, operators, numbers, etc., and highlights them appropriately. This is doing a lot of the same
work as the scanner stage of the Bminor compiler.
ftdetect
just checks a file's extension (*.bminor
) and uses the appropriate highlighting.
vim reference docs: http://vimdoc.sourceforge.net/htmldoc/syntax.html