You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 11 години
преди 12 години
преди 12 години
преди 12 години
преди 11 години
преди 12 години
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. """
  2. """ Experimental Lol Engine Vim plugin
  3. """
  4. """ More info here:
  5. """ http://lolengine.net/wiki/dev/setup/vim
  6. """
  7. """
  8. """ Add syntax highlighting for new C++ types
  9. """
  10. " some custom base types
  11. au Syntax cpp
  12. \ syn keyword cType
  13. \ half ldouble lldouble real uint
  14. " GLSL types and the Lol Engine extensions
  15. au Syntax cpp
  16. \ syn keyword cType
  17. \ f16vec2 f16cmplx f16vec3 f16vec4 f16quat f16mat2 f16mat3 f16mat4
  18. \ vec2 cmplx vec3 vec4 quat mat2 mat3 mat4
  19. \ f64vec2 f64cmplx f64vec3 f64vec4 f64quat f64mat2 f64mat3 f64mat4
  20. \ f128vec2 f128cmplx f128vec3 f128vec4 f128quat f128mat2 f128mat3 f128mat4
  21. \ rvec2 rcmplx rvec3 rvec4 rquat rmat2 rmat3 rmat4
  22. \
  23. \ i8vec2 i8cmplx i8vec3 i8vec4 i8quat i8mat2 i8mat3 i8mat4
  24. \ u8vec2 u8cmplx u8vec3 u8vec4 u8quat u8mat2 u8mat3 u8mat4
  25. \ i16vec2 i16cmplx i16vec3 i16vec4 i16quat i16mat2 i16mat3 i16mat4
  26. \ u16vec2 u16cmplx u16vec3 u16vec4 u16quat u16mat2 u16mat3 u16mat4
  27. \ ivec2 icmplx ivec3 ivec4 iquat imat2 imat3 imat4
  28. \ uvec2 ucmplx uvec3 uvec4 uquat umat2 umat3 umat4
  29. \ i64vec2 i64cmplx i64vec3 i64vec4 i64quat i64mat2 i64mat3 i64mat4
  30. \ u64vec2 u64cmplx u64vec3 u64vec4 u64quat u64mat2 u64mat3 u64mat4
  31. " HLSL types
  32. au Syntax cpp
  33. \ syn keyword cType
  34. \ int2 int3 int4 int2x2 int3x3 int4x4
  35. \ float2 float3 float4 float2x2 float3x3 float4x4
  36. " More GLSL-like types from the Lol Engine
  37. au Syntax cpp
  38. \ syn keyword cType
  39. \ box2 dbox2 ibox2 ubox2
  40. \ box3 dbox3 ibox3 ubox3
  41. " Ensure we know about nullptr
  42. au Syntax cpp
  43. \ syn keyword cConstant
  44. \ nullptr
  45. " New maths constants
  46. au Syntax cpp
  47. \ syn match cConstant
  48. \ "\<\(F\|D\|LD\)_\(PI\|PI_[234]\|[12]_PI\|SQRT_[23]\|SQRT_1_2\)\>"
  49. " Global keywords
  50. au Syntax cpp
  51. \ syn keyword cConstant
  52. \ UNUSED ASSERT
  53. """
  54. """ LolFx language handler
  55. """
  56. " For now, pretend .lolfx is C++
  57. au BufRead,BufNewFile *.lolfx set syntax=cpp
  58. " New sampler types (GLSL)
  59. au BufRead,BufNewFile *.lolfx syn match cType
  60. \ "\<sampler\(\([12]D\|Cube\)\(Array\|\)\(Shadow\|\)\)\>"
  61. \ "\<sampler\(3D\|2DRect\|Buffer\|2DMS\|2DMSArray\|2DRectShadow\)\>"
  62. " Type constructs (LolFx)
  63. au BufRead,BufNewFile *.lolfx syn keyword cppStructure
  64. \ technique pass precision
  65. " Variable attributes (GLSL and some HLSL)
  66. au BufRead,BufNewFile *.lolfx syn keyword cType
  67. \ in out uniform attribute varying
  68. " Texture operators (GLSL and HLSL)
  69. au BufRead,BufNewFile *.lolfx syn keyword cppOperator
  70. \ texture1D texture2D texture3D tex2D tex3D
  71. " Handle #version constructs
  72. au BufRead,BufNewFile *.lolfx syn region cPreProc
  73. \ start="^\s*\(%:\|#\)\s*version\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
  74. " LolFx shader region
  75. au BufRead,BufNewFile *.lolfx syn region cSpecial
  76. \ start="^\s*\[[^\]]*\(glsl\|hlsl\)\]" end="$" contains=ALLBUT,@cPreProcGroup,@Spell