Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

182 lines
4.3 KiB

  1. " note do not change the order...
  2. " some of them are overridding privous regrex
  3. "this code made with build-in syntax regrex(and key words), and with some custome regrex(and
  4. "key words)
  5. """"""""""""""""""""""""""""""""""""""""""""""""""""""""
  6. " gruvbox (dark)
  7. "let orange = "#d65d0e" "special color for numbers
  8. "let black = "#282828"
  9. "let red = "#cc241d"
  10. "let green = "#98971a"
  11. "let yellow = "#d79921"
  12. "let blue = "#458588"
  13. "let purple = "#b16286"
  14. "let cyan = "#689d6a"
  15. "let white = "#a89984"
  16. " one dark
  17. let orange = "#d19a66" "special color for numbers
  18. let black = "#282c34"
  19. let red = "#E06C75"
  20. let green = "#98c379"
  21. let yellow = "#E5C07B"
  22. let blue = "#61AFEF"
  23. let purple = "#C678DD"
  24. let cyan = "#56B6C2"
  25. let white = "#ABB2BF"
  26. " you may chage the color according to your will :)
  27. " main color (for left over words)
  28. syn match main "\w"
  29. execute "highlight main ctermfg=4 guifg=".red
  30. " numbers
  31. syn match posNum "\d"
  32. execute "highlight posNum ctermfg=4 guifg=".orange
  33. " method names()
  34. syn match class ".\w*\((\)\@="
  35. execute "highlight class ctermfg=4 guifg=".blue
  36. "execute "highlight names which contains numbers
  37. syn match main "\v(\a)\w*\d"
  38. execute "highlight main ctermfg=4 guifg=".red
  39. "all regrex works
  40. " /^import (+);$/mg
  41. " import \zs.*\ze
  42. " \v(^import\s+)@<=.*;
  43. " imported packages
  44. syn match importName "\v(^import\s+)@<=.*;"
  45. execute "highlight importName ctermfg=4 guifg=".yellow
  46. " import
  47. syn match importWord "import "
  48. execute "highlight importWord ctermfg=4 guifg=".purple
  49. " package name
  50. syn match packageName "\v(^package\s+)@<=.*;"
  51. execute "highlight packageName ctermfg=4 guifg=".yellow
  52. " package
  53. syn match packageWord "package "
  54. execute "highlight packageWord ctermfg=4 guifg=".purple
  55. "ex: int, double, char
  56. execute "highlight javaType ctermfg=4 guifg=".purple
  57. "ex: static, throws
  58. execute "highlight javaStorageClass ctermfg=4 guifg=".purple
  59. "class name... basically starts with caps letter
  60. syntax match ClassName display '\<\([A-Z][a-z0-9]*\)\+\>'
  61. syntax match ClassName display '\.\@<=\*'
  62. highlight link ClassName Identifier
  63. execute "highlight ClassName ctermfg=4 guifg=".yellow
  64. " Just some special color, why not?
  65. syn match print " System.out."
  66. execute "highlight print ctermfg=4 guifg=".yellow
  67. "objects (ex: String)
  68. execute "highlight Constant ctermfg=4 guifg=".yellow
  69. " class
  70. syn match javaClassDecl2 " class\> "
  71. execute "highlight javaClassDecl2 ctermfg=4 guifg=".purple
  72. " package
  73. execute "highlight javaExternal ctermfg=4 guifg=".purple
  74. "if else switch
  75. execute "highlight javaConditional ctermfg=4 guifg=".purple
  76. "while for do
  77. execute "highlight javaRepeat ctermfg=4 guifg=".purple
  78. "true flase
  79. execute "highlight javaBoolean ctermfg=4 guifg=".orange
  80. " null
  81. syn match null "\v[ =]null[; ]"
  82. execute "highlight null ctermfg=4 guifg=".orange
  83. " this super
  84. execute "highlight javaTypedef ctermfg=4 guifg=".purple
  85. " var new instanceof
  86. execute "highlight javaOperator ctermfg=4 guifg=".purple
  87. " return
  88. execute "highlight javaStatement ctermfg=4 guifg=".purple
  89. " static synchronized transient volatile final strictfp serializable
  90. execute "highlight javaStorageClass ctermfg=4 guifg=".purple
  91. "throw try catch finally
  92. execute "highlight javaExceptions ctermfg=4 guifg=".purple
  93. " assert
  94. execute "highlight javaAssert ctermfg=4 guifg=".purple
  95. " synchronized throws
  96. execute "highlight javaMethodDecl ctermfg=4 guifg=".red
  97. " extends implements interface
  98. execute "highlight javaClassDecl ctermfg=4 guifg=".red
  99. " interface
  100. execute "highlight javaClassDecl ctermfg=4 guifg=".purple
  101. " break continue skipwhite
  102. execute "highlight javaBranch ctermfg=4 guifg=".purple
  103. " public protected private abstract
  104. execute "highlight javaScopeDecl ctermfg=4 guifg=".purple
  105. """"""""""""""""""""""""""""""""""""""'
  106. " java 9...
  107. " module transitive
  108. execute "highlight javaModuleStorageClass ctermfg=4 guifg=".purple
  109. " open requires exports opens uses provides
  110. execute "highlight javaModuleStmt ctermfg=4 guifg=".yellow
  111. " to with
  112. execute "highlight javaModuleExternal ctermfg=4 guifg=".red
  113. """""""""""""""""""""""""""""""""""""""""
  114. " lambda
  115. execute "highlight javaLambdaDef ctermfg=4 guifg=".cyan
  116. """"""""""""""""""""""""""""""""""""""""""
  117. " clone equals finalize getClass hashCode
  118. " notify notifyAll toString wait
  119. execute "highlight javaLangObject ctermfg=4 guifg=".yellow
  120. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""