about summary refs log tree commit diff stats
path: root/vimrc.vim
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-07 12:47:25 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-07 12:47:25 -0700
commit94fa5c95ad9c8beead183bb7c4b88c7c2c7ca6ec (patch)
tree57220c2686078b9ac4e5d9971fc81606a111e21f /vimrc.vim
parent8833d01ccf23a9348572d1cd3c34342b4ae2e6e3 (diff)
downloadmu-94fa5c95ad9c8beead183bb7c4b88c7c2c7ca6ec.tar.gz
1297
Diffstat (limited to 'vimrc.vim')
-rw-r--r--vimrc.vim13
1 files changed, 8 insertions, 5 deletions
diff --git a/vimrc.vim b/vimrc.vim
index 42d17fc0..34fbbb9d 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -1,9 +1,14 @@
 " Highlighting literate directives in C++ sources.
 function! HighlightTangledFile()
+  " Tangled comments only make sense in the sources and are stripped out of
+  " the generated .cc file. They're highlighted same as regular comments.
+  syntax match tangledComment /\/\/:.*/ | highlight link tangledComment Comment
+  syntax match tangledSalientComment /\/\/::.*/ | highlight link tangledSalientComment SalientComment
   set comments-=://
   set comments-=n://
   set comments+=n://:,n://
 
+  " Inside tangle scenarios.
   syntax region tangleDirective start=+:(+ skip=+".*"+ end=+)+
   highlight link tangleDirective Delimiter
   syntax match traceContains /^+.*/
@@ -11,16 +16,14 @@ function! HighlightTangledFile()
   syntax match traceAbsent /^-.*/
   highlight traceAbsent ctermfg=darkred
   syntax match tangleScenarioSetup /^\s*% .*/ | highlight link tangleScenarioSetup SpecialChar
+
   " Our C++ files can have mu code in scenarios, so highlight mu comments like
   " regular comments.
   syntax match muComment /# .*$/ | highlight link muComment Comment
   syntax match muSalientComment /##.*$/ | highlight link muSalientComment SalientComment
   syntax match muCommentedCode /#? .*$/ | highlight link muCommentedCode CommentedCode
-  " Tangled comments only make sense in the sources and are stripped out of
-  " the generated .cc file. They're highlighted same as regular comments.
-  syntax match tangledComment /\/\/:.*/ | highlight link tangledComment Comment
-  syntax match tangledSalientComment /\/\/::.*/ | highlight link tangledSalientComment SalientComment
-  " Include some bare-bones mu highlighting even in the C++ sources.
+  set comments+=n:#
+  " Some other bare-bones mu highlighting.
   syntax match muAssign " <- " | highlight link muAssign SpecialChar
   syntax match muAssign "\<raw\>"
 endfunction