about summary refs log tree commit diff stats
path: root/vimrc.vim
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-30 10:45:14 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-30 10:45:14 -0700
commit3e1349d29fa00db1fab3a811b60bc9d8de0355e4 (patch)
tree93afedf36b8b211432a458ca9c0c7bfaf76e2425 /vimrc.vim
parent6c69569a4c4ca3a23635d4d7a40f0fe557194619 (diff)
downloadmu-3e1349d29fa00db1fab3a811b60bc9d8de0355e4.tar.gz
3431
Improvements to syntax highlighting, particularly for Mu code in C++
files.
Diffstat (limited to 'vimrc.vim')
-rw-r--r--vimrc.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/vimrc.vim b/vimrc.vim
index a3f31d1e..32c96159 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -24,7 +24,19 @@ function! HighlightTangledFile()
   syntax match muCommentedCode /#? .*$/ | highlight link muCommentedCode CommentedCode
   set comments+=n:#
   " Some other bare-bones mu highlighting.
+  syntax match muLiteral %[^ ]\+:literal/[^ ,]*\|[^ ]\+:literal\>%
+  syntax match muLiteral %[^ ]\+:label/[^ ,]*\|[^ ]\+:label\>%
+  syntax match muLiteral %[^ ]\+:type/[^ ,]*\|[^ ]\+:type\>%
+  syntax match muLiteral %[^ ]\+:offset/[^ ,]*\|[^ ]\+:offset\>%
+  syntax match muLiteral %[^ ]\+:variant/[^ ,]*\|[^ ]\+:variant\>%
+  highlight link muLiteral Constant
   syntax match muAssign " <- \|\<raw\>" | highlight link muAssign SpecialChar
+  syntax match muGlobal %[^ ]\+:global/[^ ,]*\|[^ ]\+:global\>% | highlight link muGlobal SpecialChar
+  " common keywords
+  syntax match muRecipe "^recipe\>\|^recipe!\>\|^def\>\|^def!\>\|^before\>\|^after\>\| -> " | highlight muRecipe ctermfg=208
+  syntax match muScenario "^scenario\>" | highlight muScenario ctermfg=34
+  syntax match muPendingScenario "^pending-scenario\>" | highlight link muPendingScenario SpecialChar
+  syntax match muData "^type\>\|^container\>\|^exclusive-container\>" | highlight muData ctermfg=226
 endfunction
 call HighlightTangledFile()
 autocmd BufRead,BufNewFile *.mu set ft=mu