Added `syntax_highlighting/` folder and instructions for vim and neatvi.
[vvhitespace] / syntax_highlighting / vvhitespace.vim
diff --git a/syntax_highlighting/vvhitespace.vim b/syntax_highlighting/vvhitespace.vim
new file mode 100644 (file)
index 0000000..8c0e095
--- /dev/null
@@ -0,0 +1,42 @@
+" Vim syntax file
+" Language: VVhitespace
+" Based on: https://vim.fandom.com/wiki/Creating_your_own_syntax_files
+
+if exists("b:current_syntax")
+  finish
+endif
+
+let b:current_synax = "vvhitespace"
+
+" Stack IMP
+syn match stackIMP '^[sS][sS]'
+syn match stackIMP '^[sS][nN][sStTnN]'
+
+" Arithmetic IMP
+syn match arithIMP '^[tT][sS][sStT][sStTnN]'
+
+" Heap IMP
+syn match heapIMP '^[tT][tT][sStT]'
+
+" Control Flow IMP
+syn match controlIMP '^[nN][nNsStT][nNsStT]'
+
+" IO IMP
+syn match ioIMP '^[tT][nN][sStT][sStT]'
+
+" Label Definition
+syn match labelDef 'V[sStT]\+N'
+
+" Comments
+syn match commentBlock '|.*$'
+syn match commentBlock '@.*$'
+
+" Define colors using existing Highlight Groups.
+" To see a list of other Highlight Groups, type `:highlight` in vim.
+hi def link stackIMP     Type
+hi def link arithIMP     ModeMsg
+hi def link heapIMP      Special
+hi def link controlIMP   Constant
+hi def link ioIMP        Keyword
+hi def link labelDef     Function
+hi def link commentBlock NonText