vim_syntax_highlight.txt 782 B

123456789101112131415161718192021222324
  1. For comun syntax highlight in vim, add the following code to your .vimrc file,
  2. then use :CmnHighlight from vim to highlight a file. To export comun highlight
  3. as HTML you can use the TOHtml vim plugin.
  4. function! CmnHigh()
  5. syntax match CmnCom /#[^#\n]*[#\n]/
  6. syntax match CmnStr /"[^"]*"/
  7. syntax match CmnFun /\(\a\|_\)\w*:/
  8. syntax match CmnDir /\~\S\+/
  9. syntax match CmnPtr /\$\S*/
  10. syntax match CmnCtr /\(!\?@\+'\?\|\(\n\| \)?\( \|\n\|'\)\|;\|!\?\.\)/
  11. syntax match CmnPre /\[[^\[\]]*\]/
  12. highlight CmnCom ctermfg=gray
  13. highlight CmnStr ctermfg=green
  14. highlight CmnFun ctermfg=yellow
  15. highlight CmnDir ctermfg=magenta
  16. highlight CmnPtr ctermfg=brown
  17. highlight CmnCtr ctermfg=red
  18. highlight CmnPre ctermfg=blue
  19. endfunction
  20. :command CmnHighlight :call CmnHigh()