pyrex.vim 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. " Vim syntax file
  2. " Language: Pyrex
  3. " Maintainer: Marco Barisione <marco.bari@people.it>
  4. " URL: http://marcobari.altervista.org/pyrex_vim.html
  5. " Last Change: 2009 Nov 09
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. " Read the Python syntax to start with
  11. runtime! syntax/python.vim
  12. unlet b:current_syntax
  13. " Pyrex extentions
  14. syn keyword pyrexStatement cdef typedef ctypedef sizeof
  15. syn keyword pyrexType int long short float double char object void
  16. syn keyword pyrexType signed unsigned
  17. syn keyword pyrexStructure struct union enum
  18. syn keyword pyrexInclude include cimport
  19. syn keyword pyrexAccess public private property readonly extern
  20. " If someome wants Python's built-ins highlighted probably he
  21. " also wants Pyrex's built-ins highlighted
  22. if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
  23. syn keyword pyrexBuiltin NULL
  24. endif
  25. " This deletes "from" from the keywords and re-adds it as a
  26. " match with lower priority than pyrexForFrom
  27. syn clear pythonInclude
  28. syn keyword pythonInclude import
  29. syn match pythonInclude "from"
  30. " With "for[^:]*\zsfrom" VIM does not match "for" anymore, so
  31. " I used the slower "\@<=" form
  32. syn match pyrexForFrom "\(for[^:]*\)\@<=from"
  33. " Default highlighting
  34. hi def link pyrexStatement Statement
  35. hi def link pyrexType Type
  36. hi def link pyrexStructure Structure
  37. hi def link pyrexInclude PreCondit
  38. hi def link pyrexAccess pyrexStatement
  39. if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
  40. hi def link pyrexBuiltin Function
  41. endif
  42. hi def link pyrexForFrom Statement
  43. let b:current_syntax = "pyrex"