about summary refs log tree commit diff stats
path: root/cpp/vimrc.vim
blob: 9d347ba618511ae4ee73fb4126a63a9ec19a85ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
" Highlighting wart's literate directives in C++ sources.
function! HighlightTangledFile()
  if &ft == ""
    set ft=cpp
  endif
  syntax region wartTangle start=+:(+ skip=+".*"+ end=+)+
  highlight link wartTangle Delimiter
  syntax region wartTrace start="^+" end="$"
  highlight wartTrace ctermfg=darkgreen
  syntax region wartTraceAbsent start="^-" end="$"
  highlight wartTraceAbsent ctermfg=darkred
  syntax region wartTraceResult start="^=>" end="$"
  highlight wartTraceResult ctermfg=darkgreen cterm=bold
  syntax region wartComment start="# " end="$"
  highlight link wartComment Comment
endfunction
call HighlightTangledFile()
autocmd BufReadPost,BufNewFile 0* call HighlightTangledFile()

set isk+=-
syntax keyword muControl next-ingredient reply jump jump-if jump-unless loop loop-if loop-unless break-if break-unless | highlight link muControl Identifier
syntax match muAssign "<-" | highlight link muAssign SpecialChar
syntax match muAssign "\<raw\>"