xkb.vim 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. " Vim syntax file
  2. " This is a GENERATED FILE. Please always refer to source file at the URI below.
  3. " Language: XKB (X Keyboard Extension) components
  4. " Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
  5. " Last Change: 2020 Oct 18
  6. " URL: http://trific.ath.cx/Ftp/vim/syntax/xkb.vim
  7. " Setup
  8. " quit when a syntax file was already loaded
  9. if exists("b:current_syntax")
  10. finish
  11. endif
  12. syn case match
  13. syn sync minlines=100
  14. " Comments
  15. syn region xkbComment start="//" skip="\\$" end="$" keepend contains=xkbTodo
  16. syn region xkbComment start="/\*" matchgroup=NONE end="\*/" contains=xkbCommentStartError,xkbTodo
  17. syn match xkbCommentError "\*/"
  18. syntax match xkbCommentStartError "/\*" contained
  19. syn sync ccomment xkbComment
  20. syn keyword xkbTodo TODO FIXME contained
  21. " Literal strings
  22. syn match xkbSpecialChar "\\\d\d\d\|\\." contained
  23. syn region xkbString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=xkbSpecialChar oneline
  24. " Catch errors caused by wrong parenthesization
  25. syn region xkbParen start='(' end=')' contains=ALLBUT,xkbParenError,xkbSpecial,xkbTodo transparent
  26. syn match xkbParenError ")"
  27. syn region xkbBrace start='{' end='}' contains=ALLBUT,xkbBraceError,xkbSpecial,xkbTodo transparent
  28. syn match xkbBraceError "}"
  29. syn region xkbBracket start='\[' end='\]' contains=ALLBUT,xkbBracketError,xkbSpecial,xkbTodo transparent
  30. syn match xkbBracketError "\]"
  31. " Physical keys
  32. syn match xkbPhysicalKey "<\w\+>"
  33. " Keywords
  34. syn keyword xkbPreproc augment include replace
  35. syn keyword xkbConstant False True
  36. syn keyword xkbModif override replace
  37. syn keyword xkbIdentifier action affect alias allowExplicit approx baseColor button clearLocks color controls cornerRadius count ctrls description driveskbd font fontSize gap group groups height indicator indicatorDrivesKeyboard interpret key keys labelColor latchToLock latchMods left level_name map maximum minimum modifier_map modifiers name offColor onColor outline preserve priority repeat row section setMods shape slant solid symbols text top type useModMapMods virtualModifier virtualMods virtual_modifiers weight whichModState width
  38. syn keyword xkbFunction AnyOf ISOLock LatchGroup LatchMods LockControls LockGroup LockMods LockPointerButton MovePtr NoAction PointerButton SetControls SetGroup SetMods SetPtrDflt Terminate
  39. syn keyword xkbTModif default hidden partial virtual
  40. syn keyword xkbSect alphanumeric_keys alternate_group function_keys keypad_keys modifier_keys xkb_compatibility xkb_geometry xkb_keycodes xkb_keymap xkb_semantics xkb_symbols xkb_types
  41. " Define the default highlighting
  42. hi def link xkbModif xkbPreproc
  43. hi def link xkbTModif xkbPreproc
  44. hi def link xkbPreproc Preproc
  45. hi def link xkbIdentifier Keyword
  46. hi def link xkbFunction Function
  47. hi def link xkbSect Type
  48. hi def link xkbPhysicalKey Identifier
  49. hi def link xkbKeyword Keyword
  50. hi def link xkbComment Comment
  51. hi def link xkbTodo Todo
  52. hi def link xkbConstant Constant
  53. hi def link xkbString String
  54. hi def link xkbSpecialChar xkbSpecial
  55. hi def link xkbSpecial Special
  56. hi def link xkbParenError xkbBalancingError
  57. hi def link xkbBraceError xkbBalancingError
  58. hi def link xkbBraketError xkbBalancingError
  59. hi def link xkbBalancingError xkbError
  60. hi def link xkbCommentStartError xkbCommentError
  61. hi def link xkbCommentError xkbError
  62. hi def link xkbError Error
  63. let b:current_syntax = "xkb"