123456789101112131415161718192021222324 |
- For comun syntax highlight in vim, add the following code to your .vimrc file,
- then use :CmnHighlight from vim to highlight a file. To export comun highlight
- as HTML you can use the TOHtml vim plugin.
- function! CmnHigh()
- syntax match CmnCom /#[^#\n]*[#\n]/
- syntax match CmnStr /"[^"]*"/
- syntax match CmnFun /\(\a\|_\)\w*:/
- syntax match CmnDir /\~\S\+/
- syntax match CmnPtr /\$\S*/
- syntax match CmnCtr /\(!\?@\+'\?\|\(\n\| \)?\( \|\n\|'\)\|;\|!\?\.\)/
- syntax match CmnPre /\[[^\[\]]*\]/
- highlight CmnCom ctermfg=gray
- highlight CmnStr ctermfg=green
- highlight CmnFun ctermfg=yellow
- highlight CmnDir ctermfg=magenta
- highlight CmnPtr ctermfg=brown
- highlight CmnCtr ctermfg=red
- highlight CmnPre ctermfg=blue
- endfunction
- :command CmnHighlight :call CmnHigh()
|