fdcc.vim 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. " Vim syntax file
  2. " Language: fdcc or locale files
  3. " Maintainer: Dwayne Bailey <dwayne@translate.org.za>
  4. " Last Change: 2004 May 16
  5. " Remarks: FDCC (Formal Definitions of Cultural Conventions) see ISO TR 14652
  6. " quit when a syntax file was already loaded
  7. if exists("b:current_syntax")
  8. finish
  9. endif
  10. syn sync minlines=150
  11. setlocal iskeyword+=-
  12. " Numbers
  13. syn match fdccNumber /[0-9]*/ contained
  14. " Unicode codings and strings
  15. syn match fdccUnicodeInValid /<[^<]*>/ contained
  16. syn match fdccUnicodeValid /<U[0-9A-F][0-9A-F][0-9A-F][0-9A-F]>/ contained
  17. syn region fdccString start=/"/ end=/"/ contains=fdccUnicodeInValid,fdccUnicodeValid
  18. " Valid LC_ Keywords
  19. syn keyword fdccKeyword escape_char comment_char
  20. syn keyword fdccKeywordIdentification title source address contact email tel fax language territory revision date category
  21. syn keyword fdccKeywordCtype copy space translit_start include translit_end outdigit class
  22. syn keyword fdccKeywordCollate copy script order_start order_end collating-symbol reorder-after reorder-end collating-element symbol-equivalence
  23. syn keyword fdccKeywordMonetary copy int_curr_symbol currency_symbol mon_decimal_point mon_thousands_sep mon_grouping positive_sign negative_sign int_frac_digits frac_digits p_cs_precedes p_sep_by_space n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn int_p_cs_precedes int_p_sep_by_space int_n_cs_precedes int_n_sep_by_space int_p_sign_posn int_n_sign_posn
  24. syn keyword fdccKeywordNumeric copy decimal_point thousands_sep grouping
  25. syn keyword fdccKeywordTime copy abday day abmon mon d_t_fmt d_fmt t_fmt am_pm t_fmt_ampm date_fmt era_d_fmt first_weekday first_workday week cal_direction time_zone era alt_digits era_d_t_fmt
  26. syn keyword fdccKeywordMessages copy yesexpr noexpr yesstr nostr
  27. syn keyword fdccKeywordPaper copy height width
  28. syn keyword fdccKeywordTelephone copy tel_int_fmt int_prefix tel_dom_fmt int_select
  29. syn keyword fdccKeywordMeasurement copy measurement
  30. syn keyword fdccKeywordName copy name_fmt name_gen name_mr name_mrs name_miss name_ms
  31. syn keyword fdccKeywordAddress copy postal_fmt country_name country_post country_ab2 country_ab3 country_num country_car country_isbn lang_name lang_ab lang_term lang_lib
  32. " Comments
  33. syn keyword fdccTodo TODO FIXME contained
  34. syn match fdccVariable /%[a-zA-Z]/ contained
  35. syn match fdccComment /[#%].*/ contains=fdccTodo,fdccVariable
  36. " LC_ Groups
  37. syn region fdccBlank matchgroup=fdccLCIdentification start=/^LC_IDENTIFICATION$/ end=/^END LC_IDENTIFICATION$/ contains=fdccKeywordIdentification,fdccString,fdccComment
  38. syn region fdccBlank matchgroup=fdccLCCtype start=/^LC_CTYPE$/ end=/^END LC_CTYPE$/ contains=fdccKeywordCtype,fdccString,fdccComment,fdccUnicodeInValid,fdccUnicodeValid
  39. syn region fdccBlank matchgroup=fdccLCCollate start=/^LC_COLLATE$/ end=/^END LC_COLLATE$/ contains=fdccKeywordCollate,fdccString,fdccComment,fdccUnicodeInValid,fdccUnicodeValid
  40. syn region fdccBlank matchgroup=fdccLCMonetary start=/^LC_MONETARY$/ end=/^END LC_MONETARY$/ contains=fdccKeywordMonetary,fdccString,fdccComment,fdccNumber
  41. syn region fdccBlank matchgroup=fdccLCNumeric start=/^LC_NUMERIC$/ end=/^END LC_NUMERIC$/ contains=fdccKeywordNumeric,fdccString,fdccComment,fdccNumber
  42. syn region fdccBlank matchgroup=fdccLCTime start=/^LC_TIME$/ end=/^END LC_TIME$/ contains=fdccKeywordTime,fdccString,fdccComment,fdccNumber
  43. syn region fdccBlank matchgroup=fdccLCMessages start=/^LC_MESSAGES$/ end=/^END LC_MESSAGES$/ contains=fdccKeywordMessages,fdccString,fdccComment
  44. syn region fdccBlank matchgroup=fdccLCPaper start=/^LC_PAPER$/ end=/^END LC_PAPER$/ contains=fdccKeywordPaper,fdccString,fdccComment,fdccNumber
  45. syn region fdccBlank matchgroup=fdccLCTelephone start=/^LC_TELEPHONE$/ end=/^END LC_TELEPHONE$/ contains=fdccKeywordTelephone,fdccString,fdccComment
  46. syn region fdccBlank matchgroup=fdccLCMeasurement start=/^LC_MEASUREMENT$/ end=/^END LC_MEASUREMENT$/ contains=fdccKeywordMeasurement,fdccString,fdccComment,fdccNumber
  47. syn region fdccBlank matchgroup=fdccLCName start=/^LC_NAME$/ end=/^END LC_NAME$/ contains=fdccKeywordName,fdccString,fdccComment
  48. syn region fdccBlank matchgroup=fdccLCAddress start=/^LC_ADDRESS$/ end=/^END LC_ADDRESS$/ contains=fdccKeywordAddress,fdccString,fdccComment,fdccNumber
  49. " Only when an item doesn't have highlighting yet
  50. hi def link fdccBlank Blank
  51. hi def link fdccTodo Todo
  52. hi def link fdccComment Comment
  53. hi def link fdccVariable Type
  54. hi def link fdccLCIdentification Statement
  55. hi def link fdccLCCtype Statement
  56. hi def link fdccLCCollate Statement
  57. hi def link fdccLCMonetary Statement
  58. hi def link fdccLCNumeric Statement
  59. hi def link fdccLCTime Statement
  60. hi def link fdccLCMessages Statement
  61. hi def link fdccLCPaper Statement
  62. hi def link fdccLCTelephone Statement
  63. hi def link fdccLCMeasurement Statement
  64. hi def link fdccLCName Statement
  65. hi def link fdccLCAddress Statement
  66. hi def link fdccUnicodeInValid Error
  67. hi def link fdccUnicodeValid String
  68. hi def link fdccString String
  69. hi def link fdccNumber Blank
  70. hi def link fdccKeywordIdentification fdccKeyword
  71. hi def link fdccKeywordCtype fdccKeyword
  72. hi def link fdccKeywordCollate fdccKeyword
  73. hi def link fdccKeywordMonetary fdccKeyword
  74. hi def link fdccKeywordNumeric fdccKeyword
  75. hi def link fdccKeywordTime fdccKeyword
  76. hi def link fdccKeywordMessages fdccKeyword
  77. hi def link fdccKeywordPaper fdccKeyword
  78. hi def link fdccKeywordTelephone fdccKeyword
  79. hi def link fdccKeywordMeasurement fdccKeyword
  80. hi def link fdccKeywordName fdccKeyword
  81. hi def link fdccKeywordAddress fdccKeyword
  82. hi def link fdccKeyword Identifier
  83. let b:current_syntax = "fdcc"
  84. " vim: ts=8