zk.vim 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. " Syntax highlighting for zkas scripts.
  2. " Symlink into ~/.vim/syntax/zk.vim
  3. " Add to your vim init file:
  4. " au BufNewFile,BufRead,BufReadPost *.zk set syntax=zk
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. syn keyword zkasKeyword
  9. \ constant
  10. \ contract
  11. \ circuit
  12. syn keyword zkasType
  13. \ EcPoint EcFixedPoint EcFixedPointBase EcFixedPointShort
  14. \ Base BaseArray Scalar ScalarArray
  15. \ MerklePath
  16. \ Uint32 Uint64
  17. syn keyword zkasInstruction
  18. \ ec_add ec_mul ec_mul_base ec_mul_short
  19. \ ec_get_x ec_get_y
  20. \ base_add base_mul base_sub
  21. \ poseidon_hash merkle_root constrain_instance
  22. \ range_check less_than bool_check witness_base
  23. syn region zkasString start='"' end='"' contained
  24. syn keyword zkasTodo contained TODO FIXME XXX NOTE
  25. syn match zkasComment "#.*$" contains=zkasTodo
  26. hi def link zkasKeyword Statement
  27. hi def link zkasType Type
  28. hi def link zkasInstruction Function
  29. hi def link zkasString Constant
  30. hi def link zkasTodo Todo
  31. hi def link zkasComment Comment
  32. let b:current_syntax = "zk"