Skip to content
Browse files

Initial

  • Loading branch information...
0 parents commit 6cae6c9e8d52966a666fd0cfd19f999161e2000e Rob Conery committed May 15, 2010
Showing with 24,391 additions and 0 deletions.
  1. +17 −0 README.textile
  2. +24 −0 after/plugin/snipMate.vim
  3. +810 −0 autoload/csapprox.vim
  4. +46 −0 autoload/csapprox/common.vim
  5. +66 −0 autoload/csapprox/per_component.vim
  6. +4,607 −0 autoload/rails.vim
  7. +802 −0 autoload/rubycomplete.vim
  8. +392 −0 autoload/snipMate.vim
  9. +48 −0 colors/adam.vim
  10. +72 −0 colors/adaryn.vim
  11. +97 −0 colors/adrian.vim
  12. +37 −0 colors/aiseered.vim
  13. +44 −0 colors/aqua.vim
  14. +164 −0 colors/astronaut.vim
  15. +59 −0 colors/asu1dark.vim
  16. +59 −0 colors/automation.vim
  17. +88 −0 colors/autumn.vim
  18. +69 −0 colors/autumn2.vim
  19. +154 −0 colors/autumnleaf.vim
  20. +319 −0 colors/baycomb.vim
  21. +99 −0 colors/billw.vim
  22. +115 −0 colors/biogoo.vim
  23. +115 −0 colors/black_angus.vim
  24. +66 −0 colors/blackbeauty.vim
  25. +62 −0 colors/blackdust.vim
  26. +32 −0 colors/blacksea.vim
  27. +41 −0 colors/blue.vim
  28. +52 −0 colors/bluegreen.vim
  29. +42 −0 colors/blugrine.vim
  30. +55 −0 colors/bmichaelsen.vim
  31. +87 −0 colors/bog.vim
  32. +60 −0 colors/borland.vim
  33. +70 −0 colors/breeze.vim
  34. +83 −0 colors/brookstream.vim
  35. +32 −0 colors/brown.vim
  36. +59 −0 colors/buttercream.vim
  37. +55 −0 colors/bw.vim
  38. +32 −0 colors/c.vim
  39. +247 −0 colors/calmar256-light.vim
  40. +76 −0 colors/camo.vim
  41. +78 −0 colors/candy.vim
  42. +174 −0 colors/candycode.vim
  43. +67 −0 colors/caramel.vim
  44. +110 −0 colors/chela_light.vim
  45. +78 −0 colors/chlordane.vim
  46. +36 −0 colors/chocolateliquor.vim
  47. +52 −0 colors/clarity.vim
  48. +81 −0 colors/cleanphp.vim
  49. +60 −0 colors/coffee.vim
  50. +79 −0 colors/colorer.vim
  51. +88 −0 colors/colorscheme_template.vim
  52. +82 −0 colors/cool.vim
  53. +83 −0 colors/dante.vim
  54. +291 −0 colors/dark-ruby.vim
  55. +60 −0 colors/darkblack.vim
  56. +105 −0 colors/darkblue2.vim
  57. +80 −0 colors/darkdot.vim
  58. +52 −0 colors/darkocean.vim
  59. +117 −0 colors/darkslategray.vim
  60. +130 −0 colors/darkspectrum.vim
  61. +75 −0 colors/darktango.vim
  62. +78 −0 colors/dawn.vim
  63. +57 −0 colors/delek.vim
  64. +141 −0 colors/denim.vim
  65. +105 −0 colors/desert.vim
  66. +338 −0 colors/desert256.vim
  67. +98 −0 colors/desertEx.vim
  68. +115 −0 colors/desertedocean.vim
  69. +71 −0 colors/dusk.vim
  70. +66 −0 colors/dw_blue.vim
  71. +66 −0 colors/dw_cyan.vim
  72. +66 −0 colors/dw_green.vim
  73. +66 −0 colors/dw_orange.vim
  74. +66 −0 colors/dw_purple.vim
  75. +66 −0 colors/dw_red.vim
  76. +66 −0 colors/dw_yellow.vim
  77. +159 −0 colors/earendel.vim
  78. +69 −0 colors/earth.vim
  79. +92 −0 colors/eclipse.vim
  80. +69 −0 colors/edo_sea.vim
  81. +105 −0 colors/ekvoli.vim
  82. +63 −0 colors/emacs.vim
  83. +79 −0 colors/fine_blue.vim
  84. +67 −0 colors/fnaqevan.vim
  85. +170 −0 colors/fog.vim
  86. +79 −0 colors/freya.vim
  87. +69 −0 colors/fruit.vim
  88. +27 −0 colors/gobo.vim
  89. +70 −0 colors/golden.vim
  90. +47 −0 colors/gor.vim
  91. +42 −0 colors/gothic.vim
  92. +75 −0 colors/greyblue.vim
  93. +138 −0 colors/habiLight.vim
  94. +83 −0 colors/hhazure.vim
  95. +233 −0 colors/hhdblue.vim
  96. +233 −0 colors/hhdcyan.vim
  97. +233 −0 colors/hhdgray.vim
  98. +233 −0 colors/hhdgreen.vim
  99. +233 −0 colors/hhdmagenta.vim
  100. +234 −0 colors/hhdred.vim
  101. +235 −0 colors/hhdyellow.vim
  102. +82 −0 colors/hhorange.vim
  103. +85 −0 colors/hhpink.vim
  104. +83 −0 colors/hhspring.vim
  105. +83 −0 colors/hhteal.vim
  106. +83 −0 colors/hhviolet.vim
  107. +60 −0 colors/ibmedit.vim
  108. +66 −0 colors/impact.vim
  109. +212 −0 colors/inkpot.vim
  110. +133 −0 colors/ironman.vim
  111. +111 −0 colors/jammy.vim
  112. +72 −0 colors/jhdark.vim
  113. +80 −0 colors/jhlight.vim
  114. +115 −0 colors/leo.vim
  115. +54 −0 colors/less.vim
  116. +215 −0 colors/lettuce.vim
  117. +75 −0 colors/lilac.vim
  118. +44 −0 colors/lingodirector.vim
  119. +47 −0 colors/manxome.vim
  120. +174 −0 colors/marklar.vim
  121. +142 −0 colors/mars.vim
  122. +397 −0 colors/martin_krischik.vim
  123. +80 −0 colors/matrix.vim
  124. +147 −0 colors/metacosm.vim
  125. +102 −0 colors/midnight.vim
  126. +102 −0 colors/midnight2.vim
  127. +68 −0 colors/mod_tcsoft.vim
  128. +247 −0 colors/moria.vim
  129. +66 −0 colors/motus.vim
  130. +119 −0 colors/navajo-night.vim
  131. +65 −0 colors/navajo.vim
  132. +26 −0 colors/nedit.vim
  133. +29 −0 colors/nedit2.vim
  134. +70 −0 colors/neon.vim
  135. +116 −0 colors/neverness.vim
  136. +79 −0 colors/night.vim
  137. +111 −0 colors/nightshimmer.vim
  138. +59 −0 colors/nightwish.vim
  139. +123 −0 colors/no_quarter.vim
  140. +70 −0 colors/northsky.vim
  141. +107 −0 colors/nuvola.vim
  142. +115 −0 colors/oceanblack.vim
  143. +140 −0 colors/oceandeep.vim
  144. +105 −0 colors/oceanlight.vim
  145. +119 −0 colors/olive.vim
  146. +31 −0 colors/papayawhip.vim
  147. +597 −0 colors/peaksea.vim
  148. +53 −0 colors/potts.vim
  149. +65 −0 colors/print_bw.vim
  150. +62 −0 colors/professional.vim
  151. +538 −0 colors/ps_color.vim
  152. +1,182 −0 colors/psql.vim
  153. +82 −0 colors/putty.vim
  154. +92 −0 colors/pyte.vim
  155. +104 −0 colors/python.vim
  156. +96 −0 colors/railscasts.vim
  157. +159 −0 colors/rdark.vim
  158. +62 −0 colors/redblack.vim
  159. +112 −0 colors/relaxedgreen.vim
  160. +444 −0 colors/reloaded.vim
Sorry, we could not display the entire diff because it was too big.
17 README.textile
@@ -0,0 +1,17 @@
+h1. Usage
+
+Clone this repo into your home directory either as .vim (linux) or vimfiles (MF
+Windows).
+
+Then cd into the repo and run this to get the snippets submodule:
+
+<pre><code>
+git submodule init
+git submodule update
+</code></pre>
+
+Put this in your vimrc along with your personal hacks:
+<pre><code>
+source ~/.vim/vimrc "linux
+source ~/vimfiles/vimrc "windows
+</code></pre>
24 after/plugin/snipMate.vim
@@ -0,0 +1,24 @@
+" These are the mappings for snipMate.vim. Putting it here ensures that it
+" will be mapped after other plugins such as supertab.vim.
+if exists('s:did_snips_mappings') || &cp || version < 700
+ finish
+endif
+let s:did_snips_mappings = 1
+
+ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
+snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
+ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
+snor <bs> b<bs>
+snor ' b<bs>'
+snor <right> <esc>a
+snor <left> <esc>bi
+
+" By default load snippets in snippets_dir
+if !exists("snippets_dir")
+ finish
+endif
+
+call GetSnippets(snippets_dir, '_') " Get global snippets
+
+au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif
+" vim:noet:sw=4:ts=4:ft=vim
810 autoload/csapprox.vim
@@ -0,0 +1,810 @@
+let s:rgb = {}
+
+let s:rgb["alice blue"] = "#f0f8ff"
+let s:rgb["aliceblue"] = "#f0f8ff"
+let s:rgb["antique white"] = "#faebd7"
+let s:rgb["antiquewhite"] = "#faebd7"
+let s:rgb["antiquewhite1"] = "#ffefdb"
+let s:rgb["antiquewhite2"] = "#eedfcc"
+let s:rgb["antiquewhite3"] = "#cdc0b0"
+let s:rgb["antiquewhite4"] = "#8b8378"
+let s:rgb["aquamarine"] = "#7fffd4"
+let s:rgb["aquamarine1"] = "#7fffd4"
+let s:rgb["aquamarine2"] = "#76eec6"
+let s:rgb["aquamarine3"] = "#66cdaa"
+let s:rgb["aquamarine4"] = "#458b74"
+let s:rgb["azure"] = "#f0ffff"
+let s:rgb["azure1"] = "#f0ffff"
+let s:rgb["azure2"] = "#e0eeee"
+let s:rgb["azure3"] = "#c1cdcd"
+let s:rgb["azure4"] = "#838b8b"
+let s:rgb["beige"] = "#f5f5dc"
+let s:rgb["bisque"] = "#ffe4c4"
+let s:rgb["bisque1"] = "#ffe4c4"
+let s:rgb["bisque2"] = "#eed5b7"
+let s:rgb["bisque3"] = "#cdb79e"
+let s:rgb["bisque4"] = "#8b7d6b"
+let s:rgb["black"] = "#000000"
+let s:rgb["blanched almond"] = "#ffebcd"
+let s:rgb["blanchedalmond"] = "#ffebcd"
+let s:rgb["blue violet"] = "#8a2be2"
+let s:rgb["blue"] = "#0000ff"
+let s:rgb["blue1"] = "#0000ff"
+let s:rgb["blue2"] = "#0000ee"
+let s:rgb["blue3"] = "#0000cd"
+let s:rgb["blue4"] = "#00008b"
+let s:rgb["blueviolet"] = "#8a2be2"
+let s:rgb["brown"] = "#a52a2a"
+let s:rgb["brown1"] = "#ff4040"
+let s:rgb["brown2"] = "#ee3b3b"
+let s:rgb["brown3"] = "#cd3333"
+let s:rgb["brown4"] = "#8b2323"
+let s:rgb["burlywood"] = "#deb887"
+let s:rgb["burlywood1"] = "#ffd39b"
+let s:rgb["burlywood2"] = "#eec591"
+let s:rgb["burlywood3"] = "#cdaa7d"
+let s:rgb["burlywood4"] = "#8b7355"
+let s:rgb["cadet blue"] = "#5f9ea0"
+let s:rgb["cadetblue"] = "#5f9ea0"
+let s:rgb["cadetblue1"] = "#98f5ff"
+let s:rgb["cadetblue2"] = "#8ee5ee"
+let s:rgb["cadetblue3"] = "#7ac5cd"
+let s:rgb["cadetblue4"] = "#53868b"
+let s:rgb["chartreuse"] = "#7fff00"
+let s:rgb["chartreuse1"] = "#7fff00"
+let s:rgb["chartreuse2"] = "#76ee00"
+let s:rgb["chartreuse3"] = "#66cd00"
+let s:rgb["chartreuse4"] = "#458b00"
+let s:rgb["chocolate"] = "#d2691e"
+let s:rgb["chocolate1"] = "#ff7f24"
+let s:rgb["chocolate2"] = "#ee7621"
+let s:rgb["chocolate3"] = "#cd661d"
+let s:rgb["chocolate4"] = "#8b4513"
+let s:rgb["coral"] = "#ff7f50"
+let s:rgb["coral1"] = "#ff7256"
+let s:rgb["coral2"] = "#ee6a50"
+let s:rgb["coral3"] = "#cd5b45"
+let s:rgb["coral4"] = "#8b3e2f"
+let s:rgb["cornflower blue"] = "#6495ed"
+let s:rgb["cornflowerblue"] = "#6495ed"
+let s:rgb["cornsilk"] = "#fff8dc"
+let s:rgb["cornsilk1"] = "#fff8dc"
+let s:rgb["cornsilk2"] = "#eee8cd"
+let s:rgb["cornsilk3"] = "#cdc8b1"
+let s:rgb["cornsilk4"] = "#8b8878"
+let s:rgb["cyan"] = "#00ffff"
+let s:rgb["cyan1"] = "#00ffff"
+let s:rgb["cyan2"] = "#00eeee"
+let s:rgb["cyan3"] = "#00cdcd"
+let s:rgb["cyan4"] = "#008b8b"
+let s:rgb["dark blue"] = "#00008b"
+let s:rgb["dark cyan"] = "#008b8b"
+let s:rgb["dark goldenrod"] = "#b8860b"
+let s:rgb["dark gray"] = "#a9a9a9"
+let s:rgb["dark green"] = "#006400"
+let s:rgb["dark grey"] = "#a9a9a9"
+let s:rgb["dark khaki"] = "#bdb76b"
+let s:rgb["dark magenta"] = "#8b008b"
+let s:rgb["dark olive green"] = "#556b2f"
+let s:rgb["dark orange"] = "#ff8c00"
+let s:rgb["dark orchid"] = "#9932cc"
+let s:rgb["dark red"] = "#8b0000"
+let s:rgb["dark salmon"] = "#e9967a"
+let s:rgb["dark sea green"] = "#8fbc8f"
+let s:rgb["dark slate blue"] = "#483d8b"
+let s:rgb["dark slate gray"] = "#2f4f4f"
+let s:rgb["dark slate grey"] = "#2f4f4f"
+let s:rgb["dark turquoise"] = "#00ced1"
+let s:rgb["dark violet"] = "#9400d3"
+let s:rgb["dark yellow"] = "#bbbb00"
+let s:rgb["darkblue"] = "#00008b"
+let s:rgb["darkcyan"] = "#008b8b"
+let s:rgb["darkgoldenrod"] = "#b8860b"
+let s:rgb["darkgoldenrod1"] = "#ffb90f"
+let s:rgb["darkgoldenrod2"] = "#eead0e"
+let s:rgb["darkgoldenrod3"] = "#cd950c"
+let s:rgb["darkgoldenrod4"] = "#8b6508"
+let s:rgb["darkgray"] = "#a9a9a9"
+let s:rgb["darkgreen"] = "#006400"
+let s:rgb["darkgrey"] = "#a9a9a9"
+let s:rgb["darkkhaki"] = "#bdb76b"
+let s:rgb["darkmagenta"] = "#8b008b"
+let s:rgb["darkolivegreen"] = "#556b2f"
+let s:rgb["darkolivegreen1"] = "#caff70"
+let s:rgb["darkolivegreen2"] = "#bcee68"
+let s:rgb["darkolivegreen3"] = "#a2cd5a"
+let s:rgb["darkolivegreen4"] = "#6e8b3d"
+let s:rgb["darkorange"] = "#ff8c00"
+let s:rgb["darkorange1"] = "#ff7f00"
+let s:rgb["darkorange2"] = "#ee7600"
+let s:rgb["darkorange3"] = "#cd6600"
+let s:rgb["darkorange4"] = "#8b4500"
+let s:rgb["darkorchid"] = "#9932cc"
+let s:rgb["darkorchid1"] = "#bf3eff"
+let s:rgb["darkorchid2"] = "#b23aee"
+let s:rgb["darkorchid3"] = "#9a32cd"
+let s:rgb["darkorchid4"] = "#68228b"
+let s:rgb["darkred"] = "#8b0000"
+let s:rgb["darksalmon"] = "#e9967a"
+let s:rgb["darkseagreen"] = "#8fbc8f"
+let s:rgb["darkseagreen1"] = "#c1ffc1"
+let s:rgb["darkseagreen2"] = "#b4eeb4"
+let s:rgb["darkseagreen3"] = "#9bcd9b"
+let s:rgb["darkseagreen4"] = "#698b69"
+let s:rgb["darkslateblue"] = "#483d8b"
+let s:rgb["darkslategray"] = "#2f4f4f"
+let s:rgb["darkslategray1"] = "#97ffff"
+let s:rgb["darkslategray2"] = "#8deeee"
+let s:rgb["darkslategray3"] = "#79cdcd"
+let s:rgb["darkslategray4"] = "#528b8b"
+let s:rgb["darkslategrey"] = "#2f4f4f"
+let s:rgb["darkturquoise"] = "#00ced1"
+let s:rgb["darkviolet"] = "#9400d3"
+let s:rgb["darkyellow"] = "#bbbb00"
+let s:rgb["deep pink"] = "#ff1493"
+let s:rgb["deep sky blue"] = "#00bfff"
+let s:rgb["deeppink"] = "#ff1493"
+let s:rgb["deeppink1"] = "#ff1493"
+let s:rgb["deeppink2"] = "#ee1289"
+let s:rgb["deeppink3"] = "#cd1076"
+let s:rgb["deeppink4"] = "#8b0a50"
+let s:rgb["deepskyblue"] = "#00bfff"
+let s:rgb["deepskyblue1"] = "#00bfff"
+let s:rgb["deepskyblue2"] = "#00b2ee"
+let s:rgb["deepskyblue3"] = "#009acd"
+let s:rgb["deepskyblue4"] = "#00688b"
+let s:rgb["dim gray"] = "#696969"
+let s:rgb["dim grey"] = "#696969"
+let s:rgb["dimgray"] = "#696969"
+let s:rgb["dimgrey"] = "#696969"
+let s:rgb["dodger blue"] = "#1e90ff"
+let s:rgb["dodgerblue"] = "#1e90ff"
+let s:rgb["dodgerblue1"] = "#1e90ff"
+let s:rgb["dodgerblue2"] = "#1c86ee"
+let s:rgb["dodgerblue3"] = "#1874cd"
+let s:rgb["dodgerblue4"] = "#104e8b"
+let s:rgb["firebrick"] = "#b22222"
+let s:rgb["firebrick1"] = "#ff3030"
+let s:rgb["firebrick2"] = "#ee2c2c"
+let s:rgb["firebrick3"] = "#cd2626"
+let s:rgb["firebrick4"] = "#8b1a1a"
+let s:rgb["floral white"] = "#fffaf0"
+let s:rgb["floralwhite"] = "#fffaf0"
+let s:rgb["forest green"] = "#228b22"
+let s:rgb["forestgreen"] = "#228b22"
+let s:rgb["gainsboro"] = "#dcdcdc"
+let s:rgb["ghost white"] = "#f8f8ff"
+let s:rgb["ghostwhite"] = "#f8f8ff"
+let s:rgb["gold"] = "#ffd700"
+let s:rgb["gold1"] = "#ffd700"
+let s:rgb["gold2"] = "#eec900"
+let s:rgb["gold3"] = "#cdad00"
+let s:rgb["gold4"] = "#8b7500"
+let s:rgb["goldenrod"] = "#daa520"
+let s:rgb["goldenrod1"] = "#ffc125"
+let s:rgb["goldenrod2"] = "#eeb422"
+let s:rgb["goldenrod3"] = "#cd9b1d"
+let s:rgb["goldenrod4"] = "#8b6914"
+let s:rgb["gray"] = "#bebebe"
+let s:rgb["gray0"] = "#000000"
+let s:rgb["gray1"] = "#030303"
+let s:rgb["gray10"] = "#1a1a1a"
+let s:rgb["gray100"] = "#ffffff"
+let s:rgb["gray11"] = "#1c1c1c"
+let s:rgb["gray12"] = "#1f1f1f"
+let s:rgb["gray13"] = "#212121"
+let s:rgb["gray14"] = "#242424"
+let s:rgb["gray15"] = "#262626"
+let s:rgb["gray16"] = "#292929"
+let s:rgb["gray17"] = "#2b2b2b"
+let s:rgb["gray18"] = "#2e2e2e"
+let s:rgb["gray19"] = "#303030"
+let s:rgb["gray2"] = "#050505"
+let s:rgb["gray20"] = "#333333"
+let s:rgb["gray21"] = "#363636"
+let s:rgb["gray22"] = "#383838"
+let s:rgb["gray23"] = "#3b3b3b"
+let s:rgb["gray24"] = "#3d3d3d"
+let s:rgb["gray25"] = "#404040"
+let s:rgb["gray26"] = "#424242"
+let s:rgb["gray27"] = "#454545"
+let s:rgb["gray28"] = "#474747"
+let s:rgb["gray29"] = "#4a4a4a"
+let s:rgb["gray3"] = "#080808"
+let s:rgb["gray30"] = "#4d4d4d"
+let s:rgb["gray31"] = "#4f4f4f"
+let s:rgb["gray32"] = "#525252"
+let s:rgb["gray33"] = "#545454"
+let s:rgb["gray34"] = "#575757"
+let s:rgb["gray35"] = "#595959"
+let s:rgb["gray36"] = "#5c5c5c"
+let s:rgb["gray37"] = "#5e5e5e"
+let s:rgb["gray38"] = "#616161"
+let s:rgb["gray39"] = "#636363"
+let s:rgb["gray4"] = "#0a0a0a"
+let s:rgb["gray40"] = "#666666"
+let s:rgb["gray41"] = "#696969"
+let s:rgb["gray42"] = "#6b6b6b"
+let s:rgb["gray43"] = "#6e6e6e"
+let s:rgb["gray44"] = "#707070"
+let s:rgb["gray45"] = "#737373"
+let s:rgb["gray46"] = "#757575"
+let s:rgb["gray47"] = "#787878"
+let s:rgb["gray48"] = "#7a7a7a"
+let s:rgb["gray49"] = "#7d7d7d"
+let s:rgb["gray5"] = "#0d0d0d"
+let s:rgb["gray50"] = "#7f7f7f"
+let s:rgb["gray51"] = "#828282"
+let s:rgb["gray52"] = "#858585"
+let s:rgb["gray53"] = "#878787"
+let s:rgb["gray54"] = "#8a8a8a"
+let s:rgb["gray55"] = "#8c8c8c"
+let s:rgb["gray56"] = "#8f8f8f"
+let s:rgb["gray57"] = "#919191"
+let s:rgb["gray58"] = "#949494"
+let s:rgb["gray59"] = "#969696"
+let s:rgb["gray6"] = "#0f0f0f"
+let s:rgb["gray60"] = "#999999"
+let s:rgb["gray61"] = "#9c9c9c"
+let s:rgb["gray62"] = "#9e9e9e"
+let s:rgb["gray63"] = "#a1a1a1"
+let s:rgb["gray64"] = "#a3a3a3"
+let s:rgb["gray65"] = "#a6a6a6"
+let s:rgb["gray66"] = "#a8a8a8"
+let s:rgb["gray67"] = "#ababab"
+let s:rgb["gray68"] = "#adadad"
+let s:rgb["gray69"] = "#b0b0b0"
+let s:rgb["gray7"] = "#121212"
+let s:rgb["gray70"] = "#b3b3b3"
+let s:rgb["gray71"] = "#b5b5b5"
+let s:rgb["gray72"] = "#b8b8b8"
+let s:rgb["gray73"] = "#bababa"
+let s:rgb["gray74"] = "#bdbdbd"
+let s:rgb["gray75"] = "#bfbfbf"
+let s:rgb["gray76"] = "#c2c2c2"
+let s:rgb["gray77"] = "#c4c4c4"
+let s:rgb["gray78"] = "#c7c7c7"
+let s:rgb["gray79"] = "#c9c9c9"
+let s:rgb["gray8"] = "#141414"
+let s:rgb["gray80"] = "#cccccc"
+let s:rgb["gray81"] = "#cfcfcf"
+let s:rgb["gray82"] = "#d1d1d1"
+let s:rgb["gray83"] = "#d4d4d4"
+let s:rgb["gray84"] = "#d6d6d6"
+let s:rgb["gray85"] = "#d9d9d9"
+let s:rgb["gray86"] = "#dbdbdb"
+let s:rgb["gray87"] = "#dedede"
+let s:rgb["gray88"] = "#e0e0e0"
+let s:rgb["gray89"] = "#e3e3e3"
+let s:rgb["gray9"] = "#171717"
+let s:rgb["gray90"] = "#e5e5e5"
+let s:rgb["gray91"] = "#e8e8e8"
+let s:rgb["gray92"] = "#ebebeb"
+let s:rgb["gray93"] = "#ededed"
+let s:rgb["gray94"] = "#f0f0f0"
+let s:rgb["gray95"] = "#f2f2f2"
+let s:rgb["gray96"] = "#f5f5f5"
+let s:rgb["gray97"] = "#f7f7f7"
+let s:rgb["gray98"] = "#fafafa"
+let s:rgb["gray99"] = "#fcfcfc"
+let s:rgb["green yellow"] = "#adff2f"
+let s:rgb["green"] = "#00ff00"
+let s:rgb["green1"] = "#00ff00"
+let s:rgb["green2"] = "#00ee00"
+let s:rgb["green3"] = "#00cd00"
+let s:rgb["green4"] = "#008b00"
+let s:rgb["greenyellow"] = "#adff2f"
+let s:rgb["grey"] = "#bebebe"
+let s:rgb["grey0"] = "#000000"
+let s:rgb["grey1"] = "#030303"
+let s:rgb["grey10"] = "#1a1a1a"
+let s:rgb["grey100"] = "#ffffff"
+let s:rgb["grey11"] = "#1c1c1c"
+let s:rgb["grey12"] = "#1f1f1f"
+let s:rgb["grey13"] = "#212121"
+let s:rgb["grey14"] = "#242424"
+let s:rgb["grey15"] = "#262626"
+let s:rgb["grey16"] = "#292929"
+let s:rgb["grey17"] = "#2b2b2b"
+let s:rgb["grey18"] = "#2e2e2e"
+let s:rgb["grey19"] = "#303030"
+let s:rgb["grey2"] = "#050505"
+let s:rgb["grey20"] = "#333333"
+let s:rgb["grey21"] = "#363636"
+let s:rgb["grey22"] = "#383838"
+let s:rgb["grey23"] = "#3b3b3b"
+let s:rgb["grey24"] = "#3d3d3d"
+let s:rgb["grey25"] = "#404040"
+let s:rgb["grey26"] = "#424242"
+let s:rgb["grey27"] = "#454545"
+let s:rgb["grey28"] = "#474747"
+let s:rgb["grey29"] = "#4a4a4a"
+let s:rgb["grey3"] = "#080808"
+let s:rgb["grey30"] = "#4d4d4d"
+let s:rgb["grey31"] = "#4f4f4f"
+let s:rgb["grey32"] = "#525252"
+let s:rgb["grey33"] = "#545454"
+let s:rgb["grey34"] = "#575757"
+let s:rgb["grey35"] = "#595959"
+let s:rgb["grey36"] = "#5c5c5c"
+let s:rgb["grey37"] = "#5e5e5e"
+let s:rgb["grey38"] = "#616161"
+let s:rgb["grey39"] = "#636363"
+let s:rgb["grey4"] = "#0a0a0a"
+let s:rgb["grey40"] = "#666666"
+let s:rgb["grey41"] = "#696969"
+let s:rgb["grey42"] = "#6b6b6b"
+let s:rgb["grey43"] = "#6e6e6e"
+let s:rgb["grey44"] = "#707070"
+let s:rgb["grey45"] = "#737373"
+let s:rgb["grey46"] = "#757575"
+let s:rgb["grey47"] = "#787878"
+let s:rgb["grey48"] = "#7a7a7a"
+let s:rgb["grey49"] = "#7d7d7d"
+let s:rgb["grey5"] = "#0d0d0d"
+let s:rgb["grey50"] = "#7f7f7f"
+let s:rgb["grey51"] = "#828282"
+let s:rgb["grey52"] = "#858585"
+let s:rgb["grey53"] = "#878787"
+let s:rgb["grey54"] = "#8a8a8a"
+let s:rgb["grey55"] = "#8c8c8c"
+let s:rgb["grey56"] = "#8f8f8f"
+let s:rgb["grey57"] = "#919191"
+let s:rgb["grey58"] = "#949494"
+let s:rgb["grey59"] = "#969696"
+let s:rgb["grey6"] = "#0f0f0f"
+let s:rgb["grey60"] = "#999999"
+let s:rgb["grey61"] = "#9c9c9c"
+let s:rgb["grey62"] = "#9e9e9e"
+let s:rgb["grey63"] = "#a1a1a1"
+let s:rgb["grey64"] = "#a3a3a3"
+let s:rgb["grey65"] = "#a6a6a6"
+let s:rgb["grey66"] = "#a8a8a8"
+let s:rgb["grey67"] = "#ababab"
+let s:rgb["grey68"] = "#adadad"
+let s:rgb["grey69"] = "#b0b0b0"
+let s:rgb["grey7"] = "#121212"
+let s:rgb["grey70"] = "#b3b3b3"
+let s:rgb["grey71"] = "#b5b5b5"
+let s:rgb["grey72"] = "#b8b8b8"
+let s:rgb["grey73"] = "#bababa"
+let s:rgb["grey74"] = "#bdbdbd"
+let s:rgb["grey75"] = "#bfbfbf"
+let s:rgb["grey76"] = "#c2c2c2"
+let s:rgb["grey77"] = "#c4c4c4"
+let s:rgb["grey78"] = "#c7c7c7"
+let s:rgb["grey79"] = "#c9c9c9"
+let s:rgb["grey8"] = "#141414"
+let s:rgb["grey80"] = "#cccccc"
+let s:rgb["grey81"] = "#cfcfcf"
+let s:rgb["grey82"] = "#d1d1d1"
+let s:rgb["grey83"] = "#d4d4d4"
+let s:rgb["grey84"] = "#d6d6d6"
+let s:rgb["grey85"] = "#d9d9d9"
+let s:rgb["grey86"] = "#dbdbdb"
+let s:rgb["grey87"] = "#dedede"
+let s:rgb["grey88"] = "#e0e0e0"
+let s:rgb["grey89"] = "#e3e3e3"
+let s:rgb["grey9"] = "#171717"
+let s:rgb["grey90"] = "#e5e5e5"
+let s:rgb["grey91"] = "#e8e8e8"
+let s:rgb["grey92"] = "#ebebeb"
+let s:rgb["grey93"] = "#ededed"
+let s:rgb["grey94"] = "#f0f0f0"
+let s:rgb["grey95"] = "#f2f2f2"
+let s:rgb["grey96"] = "#f5f5f5"
+let s:rgb["grey97"] = "#f7f7f7"
+let s:rgb["grey98"] = "#fafafa"
+let s:rgb["grey99"] = "#fcfcfc"
+let s:rgb["honeydew"] = "#f0fff0"
+let s:rgb["honeydew1"] = "#f0fff0"
+let s:rgb["honeydew2"] = "#e0eee0"
+let s:rgb["honeydew3"] = "#c1cdc1"
+let s:rgb["honeydew4"] = "#838b83"
+let s:rgb["hot pink"] = "#ff69b4"
+let s:rgb["hotpink"] = "#ff69b4"
+let s:rgb["hotpink1"] = "#ff6eb4"
+let s:rgb["hotpink2"] = "#ee6aa7"
+let s:rgb["hotpink3"] = "#cd6090"
+let s:rgb["hotpink4"] = "#8b3a62"
+let s:rgb["indian red"] = "#cd5c5c"
+let s:rgb["indianred"] = "#cd5c5c"
+let s:rgb["indianred1"] = "#ff6a6a"
+let s:rgb["indianred2"] = "#ee6363"
+let s:rgb["indianred3"] = "#cd5555"
+let s:rgb["indianred4"] = "#8b3a3a"
+let s:rgb["ivory"] = "#fffff0"
+let s:rgb["ivory1"] = "#fffff0"
+let s:rgb["ivory2"] = "#eeeee0"
+let s:rgb["ivory3"] = "#cdcdc1"
+let s:rgb["ivory4"] = "#8b8b83"
+let s:rgb["khaki"] = "#f0e68c"
+let s:rgb["khaki1"] = "#fff68f"
+let s:rgb["khaki2"] = "#eee685"
+let s:rgb["khaki3"] = "#cdc673"
+let s:rgb["khaki4"] = "#8b864e"
+let s:rgb["lavender blush"] = "#fff0f5"
+let s:rgb["lavender"] = "#e6e6fa"
+let s:rgb["lavenderblush"] = "#fff0f5"
+let s:rgb["lavenderblush1"] = "#fff0f5"
+let s:rgb["lavenderblush2"] = "#eee0e5"
+let s:rgb["lavenderblush3"] = "#cdc1c5"
+let s:rgb["lavenderblush4"] = "#8b8386"
+let s:rgb["lawn green"] = "#7cfc00"
+let s:rgb["lawngreen"] = "#7cfc00"
+let s:rgb["lemon chiffon"] = "#fffacd"
+let s:rgb["lemonchiffon"] = "#fffacd"
+let s:rgb["lemonchiffon1"] = "#fffacd"
+let s:rgb["lemonchiffon2"] = "#eee9bf"
+let s:rgb["lemonchiffon3"] = "#cdc9a5"
+let s:rgb["lemonchiffon4"] = "#8b8970"
+let s:rgb["light blue"] = "#add8e6"
+let s:rgb["light coral"] = "#f08080"
+let s:rgb["light cyan"] = "#e0ffff"
+let s:rgb["light goldenrod yellow"] = "#fafad2"
+let s:rgb["light goldenrod"] = "#eedd82"
+let s:rgb["light gray"] = "#d3d3d3"
+let s:rgb["light green"] = "#90ee90"
+let s:rgb["light grey"] = "#d3d3d3"
+let s:rgb["light magenta"] = "#ffbbff"
+let s:rgb["light pink"] = "#ffb6c1"
+let s:rgb["light red"] = "#ffbbbb"
+let s:rgb["light salmon"] = "#ffa07a"
+let s:rgb["light sea green"] = "#20b2aa"
+let s:rgb["light sky blue"] = "#87cefa"
+let s:rgb["light slate blue"] = "#8470ff"
+let s:rgb["light slate gray"] = "#778899"
+let s:rgb["light slate grey"] = "#778899"
+let s:rgb["light steel blue"] = "#b0c4de"
+let s:rgb["light yellow"] = "#ffffe0"
+let s:rgb["lightblue"] = "#add8e6"
+let s:rgb["lightblue1"] = "#bfefff"
+let s:rgb["lightblue2"] = "#b2dfee"
+let s:rgb["lightblue3"] = "#9ac0cd"
+let s:rgb["lightblue4"] = "#68838b"
+let s:rgb["lightcoral"] = "#f08080"
+let s:rgb["lightcyan"] = "#e0ffff"
+let s:rgb["lightcyan1"] = "#e0ffff"
+let s:rgb["lightcyan2"] = "#d1eeee"
+let s:rgb["lightcyan3"] = "#b4cdcd"
+let s:rgb["lightcyan4"] = "#7a8b8b"
+let s:rgb["lightgoldenrod"] = "#eedd82"
+let s:rgb["lightgoldenrod1"] = "#ffec8b"
+let s:rgb["lightgoldenrod2"] = "#eedc82"
+let s:rgb["lightgoldenrod3"] = "#cdbe70"
+let s:rgb["lightgoldenrod4"] = "#8b814c"
+let s:rgb["lightgoldenrodyellow"] = "#fafad2"
+let s:rgb["lightgray"] = "#d3d3d3"
+let s:rgb["lightgreen"] = "#90ee90"
+let s:rgb["lightgrey"] = "#d3d3d3"
+let s:rgb["lightmagenta"] = "#ffbbff"
+let s:rgb["lightpink"] = "#ffb6c1"
+let s:rgb["lightpink1"] = "#ffaeb9"
+let s:rgb["lightpink2"] = "#eea2ad"
+let s:rgb["lightpink3"] = "#cd8c95"
+let s:rgb["lightpink4"] = "#8b5f65"
+let s:rgb["lightred"] = "#ffbbbb"
+let s:rgb["lightsalmon"] = "#ffa07a"
+let s:rgb["lightsalmon1"] = "#ffa07a"
+let s:rgb["lightsalmon2"] = "#ee9572"
+let s:rgb["lightsalmon3"] = "#cd8162"
+let s:rgb["lightsalmon4"] = "#8b5742"
+let s:rgb["lightseagreen"] = "#20b2aa"
+let s:rgb["lightskyblue"] = "#87cefa"
+let s:rgb["lightskyblue1"] = "#b0e2ff"
+let s:rgb["lightskyblue2"] = "#a4d3ee"
+let s:rgb["lightskyblue3"] = "#8db6cd"
+let s:rgb["lightskyblue4"] = "#607b8b"
+let s:rgb["lightslateblue"] = "#8470ff"
+let s:rgb["lightslategray"] = "#778899"
+let s:rgb["lightslategrey"] = "#778899"
+let s:rgb["lightsteelblue"] = "#b0c4de"
+let s:rgb["lightsteelblue1"] = "#cae1ff"
+let s:rgb["lightsteelblue2"] = "#bcd2ee"
+let s:rgb["lightsteelblue3"] = "#a2b5cd"
+let s:rgb["lightsteelblue4"] = "#6e7b8b"
+let s:rgb["lightyellow"] = "#ffffe0"
+let s:rgb["lightyellow1"] = "#ffffe0"
+let s:rgb["lightyellow2"] = "#eeeed1"
+let s:rgb["lightyellow3"] = "#cdcdb4"
+let s:rgb["lightyellow4"] = "#8b8b7a"
+let s:rgb["lime green"] = "#32cd32"
+let s:rgb["limegreen"] = "#32cd32"
+let s:rgb["linen"] = "#faf0e6"
+let s:rgb["magenta"] = "#ff00ff"
+let s:rgb["magenta1"] = "#ff00ff"
+let s:rgb["magenta2"] = "#ee00ee"
+let s:rgb["magenta3"] = "#cd00cd"
+let s:rgb["magenta4"] = "#8b008b"
+let s:rgb["maroon"] = "#b03060"
+let s:rgb["maroon1"] = "#ff34b3"
+let s:rgb["maroon2"] = "#ee30a7"
+let s:rgb["maroon3"] = "#cd2990"
+let s:rgb["maroon4"] = "#8b1c62"
+let s:rgb["medium aquamarine"] = "#66cdaa"
+let s:rgb["medium blue"] = "#0000cd"
+let s:rgb["medium orchid"] = "#ba55d3"
+let s:rgb["medium purple"] = "#9370db"
+let s:rgb["medium sea green"] = "#3cb371"
+let s:rgb["medium slate blue"] = "#7b68ee"
+let s:rgb["medium spring green"] = "#00fa9a"
+let s:rgb["medium turquoise"] = "#48d1cc"
+let s:rgb["medium violet red"] = "#c71585"
+let s:rgb["mediumaquamarine"] = "#66cdaa"
+let s:rgb["mediumblue"] = "#0000cd"
+let s:rgb["mediumorchid"] = "#ba55d3"
+let s:rgb["mediumorchid1"] = "#e066ff"
+let s:rgb["mediumorchid2"] = "#d15fee"
+let s:rgb["mediumorchid3"] = "#b452cd"
+let s:rgb["mediumorchid4"] = "#7a378b"
+let s:rgb["mediumpurple"] = "#9370db"
+let s:rgb["mediumpurple1"] = "#ab82ff"
+let s:rgb["mediumpurple2"] = "#9f79ee"
+let s:rgb["mediumpurple3"] = "#8968cd"
+let s:rgb["mediumpurple4"] = "#5d478b"
+let s:rgb["mediumseagreen"] = "#3cb371"
+let s:rgb["mediumslateblue"] = "#7b68ee"
+let s:rgb["mediumspringgreen"] = "#00fa9a"
+let s:rgb["mediumturquoise"] = "#48d1cc"
+let s:rgb["mediumvioletred"] = "#c71585"
+let s:rgb["midnight blue"] = "#191970"
+let s:rgb["midnightblue"] = "#191970"
+let s:rgb["mint cream"] = "#f5fffa"
+let s:rgb["mintcream"] = "#f5fffa"
+let s:rgb["misty rose"] = "#ffe4e1"
+let s:rgb["mistyrose"] = "#ffe4e1"
+let s:rgb["mistyrose1"] = "#ffe4e1"
+let s:rgb["mistyrose2"] = "#eed5d2"
+let s:rgb["mistyrose3"] = "#cdb7b5"
+let s:rgb["mistyrose4"] = "#8b7d7b"
+let s:rgb["moccasin"] = "#ffe4b5"
+let s:rgb["navajo white"] = "#ffdead"
+let s:rgb["navajowhite"] = "#ffdead"
+let s:rgb["navajowhite1"] = "#ffdead"
+let s:rgb["navajowhite2"] = "#eecfa1"
+let s:rgb["navajowhite3"] = "#cdb38b"
+let s:rgb["navajowhite4"] = "#8b795e"
+let s:rgb["navy blue"] = "#000080"
+let s:rgb["navy"] = "#000080"
+let s:rgb["navyblue"] = "#000080"
+let s:rgb["old lace"] = "#fdf5e6"
+let s:rgb["oldlace"] = "#fdf5e6"
+let s:rgb["olive drab"] = "#6b8e23"
+let s:rgb["olivedrab"] = "#6b8e23"
+let s:rgb["olivedrab1"] = "#c0ff3e"
+let s:rgb["olivedrab2"] = "#b3ee3a"
+let s:rgb["olivedrab3"] = "#9acd32"
+let s:rgb["olivedrab4"] = "#698b22"
+let s:rgb["orange red"] = "#ff4500"
+let s:rgb["orange"] = "#ffa500"
+let s:rgb["orange1"] = "#ffa500"
+let s:rgb["orange2"] = "#ee9a00"
+let s:rgb["orange3"] = "#cd8500"
+let s:rgb["orange4"] = "#8b5a00"
+let s:rgb["orangered"] = "#ff4500"
+let s:rgb["orangered1"] = "#ff4500"
+let s:rgb["orangered2"] = "#ee4000"
+let s:rgb["orangered3"] = "#cd3700"
+let s:rgb["orangered4"] = "#8b2500"
+let s:rgb["orchid"] = "#da70d6"
+let s:rgb["orchid1"] = "#ff83fa"
+let s:rgb["orchid2"] = "#ee7ae9"
+let s:rgb["orchid3"] = "#cd69c9"
+let s:rgb["orchid4"] = "#8b4789"
+let s:rgb["pale goldenrod"] = "#eee8aa"
+let s:rgb["pale green"] = "#98fb98"
+let s:rgb["pale turquoise"] = "#afeeee"
+let s:rgb["pale violet red"] = "#db7093"
+let s:rgb["palegoldenrod"] = "#eee8aa"
+let s:rgb["palegreen"] = "#98fb98"
+let s:rgb["palegreen1"] = "#9aff9a"
+let s:rgb["palegreen2"] = "#90ee90"
+let s:rgb["palegreen3"] = "#7ccd7c"
+let s:rgb["palegreen4"] = "#548b54"
+let s:rgb["paleturquoise"] = "#afeeee"
+let s:rgb["paleturquoise1"] = "#bbffff"
+let s:rgb["paleturquoise2"] = "#aeeeee"
+let s:rgb["paleturquoise3"] = "#96cdcd"
+let s:rgb["paleturquoise4"] = "#668b8b"
+let s:rgb["palevioletred"] = "#db7093"
+let s:rgb["palevioletred1"] = "#ff82ab"
+let s:rgb["palevioletred2"] = "#ee799f"
+let s:rgb["palevioletred3"] = "#cd6889"
+let s:rgb["palevioletred4"] = "#8b475d"
+let s:rgb["papaya whip"] = "#ffefd5"
+let s:rgb["papayawhip"] = "#ffefd5"
+let s:rgb["peach puff"] = "#ffdab9"
+let s:rgb["peachpuff"] = "#ffdab9"
+let s:rgb["peachpuff1"] = "#ffdab9"
+let s:rgb["peachpuff2"] = "#eecbad"
+let s:rgb["peachpuff3"] = "#cdaf95"
+let s:rgb["peachpuff4"] = "#8b7765"
+let s:rgb["peru"] = "#cd853f"
+let s:rgb["pink"] = "#ffc0cb"
+let s:rgb["pink1"] = "#ffb5c5"
+let s:rgb["pink2"] = "#eea9b8"
+let s:rgb["pink3"] = "#cd919e"
+let s:rgb["pink4"] = "#8b636c"
+let s:rgb["plum"] = "#dda0dd"
+let s:rgb["plum1"] = "#ffbbff"
+let s:rgb["plum2"] = "#eeaeee"
+let s:rgb["plum3"] = "#cd96cd"
+let s:rgb["plum4"] = "#8b668b"
+let s:rgb["powder blue"] = "#b0e0e6"
+let s:rgb["powderblue"] = "#b0e0e6"
+let s:rgb["purple"] = "#a020f0"
+let s:rgb["purple1"] = "#9b30ff"
+let s:rgb["purple2"] = "#912cee"
+let s:rgb["purple3"] = "#7d26cd"
+let s:rgb["purple4"] = "#551a8b"
+let s:rgb["red"] = "#ff0000"
+let s:rgb["red1"] = "#ff0000"
+let s:rgb["red2"] = "#ee0000"
+let s:rgb["red3"] = "#cd0000"
+let s:rgb["red4"] = "#8b0000"
+let s:rgb["rosy brown"] = "#bc8f8f"
+let s:rgb["rosybrown"] = "#bc8f8f"
+let s:rgb["rosybrown1"] = "#ffc1c1"
+let s:rgb["rosybrown2"] = "#eeb4b4"
+let s:rgb["rosybrown3"] = "#cd9b9b"
+let s:rgb["rosybrown4"] = "#8b6969"
+let s:rgb["royal blue"] = "#4169e1"
+let s:rgb["royalblue"] = "#4169e1"
+let s:rgb["royalblue1"] = "#4876ff"
+let s:rgb["royalblue2"] = "#436eee"
+let s:rgb["royalblue3"] = "#3a5fcd"
+let s:rgb["royalblue4"] = "#27408b"
+let s:rgb["saddle brown"] = "#8b4513"
+let s:rgb["saddlebrown"] = "#8b4513"
+let s:rgb["salmon"] = "#fa8072"
+let s:rgb["salmon1"] = "#ff8c69"
+let s:rgb["salmon2"] = "#ee8262"
+let s:rgb["salmon3"] = "#cd7054"
+let s:rgb["salmon4"] = "#8b4c39"
+let s:rgb["sandy brown"] = "#f4a460"
+let s:rgb["sandybrown"] = "#f4a460"
+let s:rgb["sea green"] = "#2e8b57"
+let s:rgb["seagreen"] = "#2e8b57"
+let s:rgb["seagreen1"] = "#54ff9f"
+let s:rgb["seagreen2"] = "#4eee94"
+let s:rgb["seagreen3"] = "#43cd80"
+let s:rgb["seagreen4"] = "#2e8b57"
+let s:rgb["seashell"] = "#fff5ee"
+let s:rgb["seashell1"] = "#fff5ee"
+let s:rgb["seashell2"] = "#eee5de"
+let s:rgb["seashell3"] = "#cdc5bf"
+let s:rgb["seashell4"] = "#8b8682"
+let s:rgb["sienna"] = "#a0522d"
+let s:rgb["sienna1"] = "#ff8247"
+let s:rgb["sienna2"] = "#ee7942"
+let s:rgb["sienna3"] = "#cd6839"
+let s:rgb["sienna4"] = "#8b4726"
+let s:rgb["sky blue"] = "#87ceeb"
+let s:rgb["skyblue"] = "#87ceeb"
+let s:rgb["skyblue1"] = "#87ceff"
+let s:rgb["skyblue2"] = "#7ec0ee"
+let s:rgb["skyblue3"] = "#6ca6cd"
+let s:rgb["skyblue4"] = "#4a708b"
+let s:rgb["slate blue"] = "#6a5acd"
+let s:rgb["slate gray"] = "#708090"
+let s:rgb["slate grey"] = "#708090"
+let s:rgb["slateblue"] = "#6a5acd"
+let s:rgb["slateblue1"] = "#836fff"
+let s:rgb["slateblue2"] = "#7a67ee"
+let s:rgb["slateblue3"] = "#6959cd"
+let s:rgb["slateblue4"] = "#473c8b"
+let s:rgb["slategray"] = "#708090"
+let s:rgb["slategray1"] = "#c6e2ff"
+let s:rgb["slategray2"] = "#b9d3ee"
+let s:rgb["slategray3"] = "#9fb6cd"
+let s:rgb["slategray4"] = "#6c7b8b"
+let s:rgb["slategrey"] = "#708090"
+let s:rgb["snow"] = "#fffafa"
+let s:rgb["snow1"] = "#fffafa"
+let s:rgb["snow2"] = "#eee9e9"
+let s:rgb["snow3"] = "#cdc9c9"
+let s:rgb["snow4"] = "#8b8989"
+let s:rgb["spring green"] = "#00ff7f"
+let s:rgb["springgreen"] = "#00ff7f"
+let s:rgb["springgreen1"] = "#00ff7f"
+let s:rgb["springgreen2"] = "#00ee76"
+let s:rgb["springgreen3"] = "#00cd66"
+let s:rgb["springgreen4"] = "#008b45"
+let s:rgb["steel blue"] = "#4682b4"
+let s:rgb["steelblue"] = "#4682b4"
+let s:rgb["steelblue1"] = "#63b8ff"
+let s:rgb["steelblue2"] = "#5cacee"
+let s:rgb["steelblue3"] = "#4f94cd"
+let s:rgb["steelblue4"] = "#36648b"
+let s:rgb["tan"] = "#d2b48c"
+let s:rgb["tan1"] = "#ffa54f"
+let s:rgb["tan2"] = "#ee9a49"
+let s:rgb["tan3"] = "#cd853f"
+let s:rgb["tan4"] = "#8b5a2b"
+let s:rgb["thistle"] = "#d8bfd8"
+let s:rgb["thistle1"] = "#ffe1ff"
+let s:rgb["thistle2"] = "#eed2ee"
+let s:rgb["thistle3"] = "#cdb5cd"
+let s:rgb["thistle4"] = "#8b7b8b"
+let s:rgb["tomato"] = "#ff6347"
+let s:rgb["tomato1"] = "#ff6347"
+let s:rgb["tomato2"] = "#ee5c42"
+let s:rgb["tomato3"] = "#cd4f39"
+let s:rgb["tomato4"] = "#8b3626"
+let s:rgb["turquoise"] = "#40e0d0"
+let s:rgb["turquoise1"] = "#00f5ff"
+let s:rgb["turquoise2"] = "#00e5ee"
+let s:rgb["turquoise3"] = "#00c5cd"
+let s:rgb["turquoise4"] = "#00868b"
+let s:rgb["violet red"] = "#d02090"
+let s:rgb["violet"] = "#ee82ee"
+let s:rgb["violetred"] = "#d02090"
+let s:rgb["violetred1"] = "#ff3e96"
+let s:rgb["violetred2"] = "#ee3a8c"
+let s:rgb["violetred3"] = "#cd3278"
+let s:rgb["violetred4"] = "#8b2252"
+let s:rgb["wheat"] = "#f5deb3"
+let s:rgb["wheat1"] = "#ffe7ba"
+let s:rgb["wheat2"] = "#eed8ae"
+let s:rgb["wheat3"] = "#cdba96"
+let s:rgb["wheat4"] = "#8b7e66"
+let s:rgb["white smoke"] = "#f5f5f5"
+let s:rgb["white"] = "#ffffff"
+let s:rgb["whitesmoke"] = "#f5f5f5"
+let s:rgb["yellow green"] = "#9acd32"
+let s:rgb["yellow"] = "#ffff00"
+let s:rgb["yellow1"] = "#ffff00"
+let s:rgb["yellow2"] = "#eeee00"
+let s:rgb["yellow3"] = "#cdcd00"
+let s:rgb["yellow4"] = "#8b8b00"
+let s:rgb["yellowgreen"] = "#9acd32"
+
+if has('mac') && !has('macunix')
+ let s:rgb["dark gray"] = "0x808080"
+ let s:rgb["darkgray"] = "0x808080"
+ let s:rgb["dark grey"] = "0x808080"
+ let s:rgb["darkgrey"] = "0x808080"
+ let s:rgb["gray"] = "0xc0c0c0"
+ let s:rgb["grey"] = "0xc0c0c0"
+ let s:rgb["light gray"] = "0xe0e0e0"
+ let s:rgb["lightgray"] = "0xe0e0e0"
+ let s:rgb["light grey"] = "0xe0e0e0"
+ let s:rgb["lightgrey"] = "0xe0e0e0"
+ let s:rgb["dark red"] = "0x800000"
+ let s:rgb["darkred"] = "0x800000"
+ let s:rgb["red"] = "0xdd0806"
+ let s:rgb["light red"] = "0xffa0a0"
+ let s:rgb["lightred"] = "0xffa0a0"
+ let s:rgb["dark blue"] = "0x000080"
+ let s:rgb["darkblue"] = "0x000080"
+ let s:rgb["blue"] = "0x0000d4"
+ let s:rgb["light blue"] = "0xa0a0ff"
+ let s:rgb["lightblue"] = "0xa0a0ff"
+ let s:rgb["dark green"] = "0x008000"
+ let s:rgb["darkgreen"] = "0x008000"
+ let s:rgb["green"] = "0x006411"
+ let s:rgb["light green"] = "0xa0ffa0"
+ let s:rgb["lightgreen"] = "0xa0ffa0"
+ let s:rgb["dark cyan"] = "0x008080"
+ let s:rgb["darkcyan"] = "0x008080"
+ let s:rgb["cyan"] = "0x02abea"
+ let s:rgb["light cyan"] = "0xa0ffff"
+ let s:rgb["lightcyan"] = "0xa0ffff"
+ let s:rgb["dark magenta"] = "0x800080"
+ let s:rgb["darkmagenta"] = "0x800080"
+ let s:rgb["magenta"] = "0xf20884"
+ let s:rgb["light magenta"] = "0xf0a0f0"
+ let s:rgb["lightmagenta"] = "0xf0a0f0"
+ let s:rgb["brown"] = "0x804040"
+ let s:rgb["yellow"] = "0xfcf305"
+ let s:rgb["light yellow"] = "0xffffa0"
+ let s:rgb["lightyellow"] = "0xffffa0"
+ let s:rgb["orange"] = "0xfc8000"
+ let s:rgb["purple"] = "0xa020f0"
+ let s:rgb["slateblue"] = "0x6a5acd"
+ let s:rgb["violet"] = "0x8d38c9"
+endif
+
+function! csapprox#rgb()
+ return s:rgb
+endfunction
46 autoload/csapprox/common.vim
@@ -0,0 +1,46 @@
+let s:xterm_colors = [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ]
+let s:eterm_colors = [ 0x00, 0x2A, 0x55, 0x7F, 0xAA, 0xD4 ]
+let s:konsole_colors = [ 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF ]
+let s:xterm_greys = [ 0x08, 0x12, 0x1C, 0x26, 0x30, 0x3A,
+ \ 0x44, 0x4E, 0x58, 0x62, 0x6C, 0x76,
+ \ 0x80, 0x8A, 0x94, 0x9E, 0xA8, 0xB2,
+ \ 0xBC, 0xC6, 0xD0, 0xDA, 0xE4, 0xEE ]
+
+let s:urxvt_colors = [ 0x00, 0x8B, 0xCD, 0xFF ]
+let s:urxvt_greys = [ 0x2E, 0x5C, 0x73, 0x8B,
+ \ 0xA2, 0xB9, 0xD0, 0xE7 ]
+
+" Uses &term to determine which cube should be use. If &term is set to
+" "xterm" or begins with "screen", the variables g:CSApprox_eterm and
+" g:CSApprox_konsole can be used to select a different palette.
+function! csapprox#common#PaletteType()
+ if &t_Co == 88
+ let type = 'urxvt'
+ elseif &term ==# 'xterm' || &term =~# '^screen' || &term==# 'builtin_gui'
+ if exists('g:CSApprox_konsole') && g:CSApprox_konsole
+ let type = 'konsole'
+ elseif exists('g:CSApprox_eterm') && g:CSApprox_eterm
+ let type = 'eterm'
+ else
+ let type = 'xterm'
+ endif
+ elseif &term =~? '^konsole'
+ let type = 'konsole'
+ elseif &term =~? '^eterm'
+ let type = 'eterm'
+ else
+ let type = 'xterm'
+ endif
+
+ return type
+endfunction
+
+" Retrieve the list of greyscale ramp colors for the current palette
+function! csapprox#common#Greys()
+ return (&t_Co == 88 ? s:urxvt_greys : s:xterm_greys)
+endfunction
+
+" Retrieve the list of non-greyscale ramp colors for the current palette
+function! csapprox#common#Colors()
+ return s:{csapprox#common#PaletteType()}_colors
+endfunction
66 autoload/csapprox/per_component.vim
@@ -0,0 +1,66 @@
+" Integer comparator used to sort the complete list of possible colors
+function! s:IntCompare(i1, i2)
+ return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1
+endfunc
+
+" Color comparator to find the nearest element to a given one in a given list
+function! s:NearestElemInList(elem, list)
+ let len = len(a:list)
+ for i in range(len-1)
+ if (a:elem <= (a:list[i] + a:list[i+1]) / 2)
+ return a:list[i]
+ endif
+ endfor
+ return a:list[len-1]
+endfunction
+
+" Takes 3 decimal values for r, g, and b, and returns the closest cube number.
+"
+" This approximator considers closeness based upon the individiual components.
+" For each of r, g, and b, it finds the closest cube component available on
+" the cube. If the three closest matches can combine to form a valid color,
+" this color is used, otherwise we repeat the search with the greys removed,
+" meaning that the three new matches must make a valid color when combined.
+function! csapprox#per_component#Approximate(r,g,b)
+ let hex = printf("%02x%02x%02x", a:r, a:g, a:b)
+
+ let colors = csapprox#common#Colors()
+ let greys = csapprox#common#Greys()
+ let type = csapprox#common#PaletteType()
+
+ if !exists('s:approximator_cache_'.type)
+ let s:approximator_cache_{type} = {}
+ endif
+
+ let rv = get(s:approximator_cache_{type}, hex, -1)
+ if rv != -1
+ return rv
+ endif
+
+ " Only obtain sorted list once
+ if !exists("s:".type."_greys_colors")
+ let s:{type}_greys_colors = sort(greys + colors, "s:IntCompare")
+ endif
+
+ let greys_colors = s:{type}_greys_colors
+
+ let r = s:NearestElemInList(a:r, greys_colors)
+ let g = s:NearestElemInList(a:g, greys_colors)
+ let b = s:NearestElemInList(a:b, greys_colors)
+
+ let len = len(colors)
+ if (r == g && g == b && index(greys, r) != -1)
+ let rv = 16 + len * len * len + index(greys, r)
+ else
+ let r = s:NearestElemInList(a:r, colors)
+ let g = s:NearestElemInList(a:g, colors)
+ let b = s:NearestElemInList(a:b, colors)
+ let rv = index(colors, r) * len * len
+ \ + index(colors, g) * len
+ \ + index(colors, b)
+ \ + 16
+ endif
+
+ let s:approximator_cache_{type}[hex] = rv
+ return rv
+endfunction
4,607 autoload/rails.vim
4,607 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
802 autoload/rubycomplete.vim
@@ -0,0 +1,802 @@
+" Vim completion script
+" Language: Ruby
+" Maintainer: Mark Guzman <segfault@hasno.info>
+" Info: $Id: rubycomplete.vim,v 1.39 2006/12/13 21:20:47 segy Exp $
+" URL: http://vim-ruby.rubyforge.org
+" Anon CVS: See above site
+" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
+" Maintainer Version: 0.8
+" ----------------------------------------------------------------------------
+"
+" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
+" ----------------------------------------------------------------------------
+
+" {{{ requirement checks
+if !has('ruby')
+ s:ErrMsg( "Error: Rubycomplete requires vim compiled with +ruby" )
+ s:ErrMsg( "Error: falling back to syntax completion" )
+ " lets fall back to syntax completion
+ setlocal omnifunc=syntaxcomplete#Complete
+ finish
+endif
+
+if version < 700
+ s:ErrMsg( "Error: Required vim >= 7.0" )
+ finish
+endif
+" }}} requirement checks
+
+" {{{ configuration failsafe initialization
+if !exists("g:rubycomplete_rails")
+ let g:rubycomplete_rails = 0
+endif
+
+if !exists("g:rubycomplete_classes_in_global")
+ let g:rubycomplete_classes_in_global = 0
+endif
+
+if !exists("g:rubycomplete_buffer_loading")
+ let g:rubycomplete_classes_in_global = 0
+endif
+
+if !exists("g:rubycomplete_include_object")
+ let g:rubycomplete_include_object = 0
+endif
+
+if !exists("g:rubycomplete_include_objectspace")
+ let g:rubycomplete_include_objectspace = 0
+endif
+" }}} configuration failsafe initialization
+
+" {{{ vim-side support functions
+let s:rubycomplete_debug = 0
+
+function! s:ErrMsg(msg)
+ echohl ErrorMsg
+ echo a:msg
+ echohl None
+endfunction
+
+function! s:dprint(msg)
+ if s:rubycomplete_debug == 1
+ echom a:msg
+ endif
+endfunction
+
+function! s:GetBufferRubyModule(name, ...)
+ if a:0 == 1
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "module", a:1)
+ else
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "module")
+ endif
+ return snum . '..' . enum
+endfunction
+
+function! s:GetBufferRubyClass(name, ...)
+ if a:0 >= 1
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "class", a:1)
+ else
+ let [snum,enum] = s:GetBufferRubyEntity(a:name, "class")
+ endif
+ return snum . '..' . enum
+endfunction
+
+function! s:GetBufferRubySingletonMethods(name)
+endfunction
+
+function! s:GetBufferRubyEntity( name, type, ... )
+ let lastpos = getpos(".")
+ let lastline = lastpos
+ if (a:0 >= 1)
+ let lastline = [ 0, a:1, 0, 0 ]
+ call cursor( a:1, 0 )
+ endif
+
+ let stopline = 1
+
+ let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?'
+ let [lnum,lcol] = searchpos( crex, 'w' )
+ "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' )
+
+ if lnum == 0 && lcol == 0
+ call cursor(lastpos[1], lastpos[2])
+ return [0,0]
+ endif
+
+ let curpos = getpos(".")
+ let [enum,ecol] = searchpairpos( crex, '', '\(end\|}\)', 'wr' )
+ call cursor(lastpos[1], lastpos[2])
+
+ if lnum > enum
+ return [0,0]
+ endif
+ " we found a the class def
+ return [lnum,enum]
+endfunction
+
+function! s:IsInClassDef()
+ return s:IsPosInClassDef( line('.') )
+endfunction
+
+function! s:IsPosInClassDef(pos)
+ let [snum,enum] = s:GetBufferRubyEntity( '.*', "class" )
+ let ret = 'nil'
+
+ if snum < a:pos && a:pos < enum
+ let ret = snum . '..' . enum
+ endif
+
+ return ret
+endfunction
+
+function! s:GetRubyVarType(v)
+ let stopline = 1
+ let vtp = ''
+ let pos = getpos('.')
+ let sstr = '^\s*#\s*@var\s*'.a:v.'\>\s\+[^ \t]\+\s*$'
+ let [lnum,lcol] = searchpos(sstr,'nb',stopline)
+ if lnum != 0 && lcol != 0
+ call setpos('.',pos)
+ let str = getline(lnum)
+ let vtp = substitute(str,sstr,'\1','')
+ return vtp
+ endif
+ call setpos('.',pos)
+ let ctors = '\(now\|new\|open\|get_instance'
+ if exists('g:rubycomplete_rails') && g:rubycomplete_rails == 1 && s:rubycomplete_rails_loaded == 1
+ let ctors = ctors.'\|find\|create'
+ else
+ endif
+ let ctors = ctors.'\)'
+
+ let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)'
+ let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr
+ let [lnum,lcol] = searchpos(sstr,'nb',stopline)
+ if lnum != 0 && lcol != 0
+ let str = matchstr(getline(lnum),fstr,lcol)
+ let str = substitute(str,'^=\s*','','')
+
+ call setpos('.',pos)
+ if str == '"' || str == '''' || stridx(tolower(str), '%q[') != -1
+ return 'String'
+ elseif str == '[' || stridx(str, '%w[') != -1
+ return 'Array'
+ elseif str == '{'
+ return 'Hash'
+ elseif str == '/' || str == '%r{'
+ return 'Regexp'
+ elseif strlen(str) >= 4 && stridx(str,'..') != -1
+ return 'Range'
+ elseif stridx(str, 'lambda') != -1 || str == '&'
+ return 'Proc'
+ elseif strlen(str) > 4
+ let l = stridx(str,'.')
+ return str[0:l-1]
+ end
+ return ''
+ endif
+ call setpos('.',pos)
+ return ''
+endfunction
+
+"}}} vim-side support functions
+
+"{{{ vim-side completion function
+function! rubycomplete#Init()
+ execute "ruby VimRubyCompletion.preload_rails"
+endfunction
+
+function! rubycomplete#Complete(findstart, base)
+ "findstart = 1 when we need to get the text length
+ if a:findstart
+ let line = getline('.')
+ let idx = col('.')
+ while idx > 0
+ let idx -= 1
+ let c = line[idx-1]
+ if c =~ '\w'
+ continue
+ elseif ! c =~ '\.'
+ idx = -1
+ break
+ else
+ break
+ endif
+ endwhile
+
+ return idx
+ "findstart = 0 when we need to return the list of completions
+ else
+ let g:rubycomplete_completions = []
+ execute "ruby VimRubyCompletion.get_completions('" . a:base . "')"
+ return g:rubycomplete_completions
+ endif
+endfunction
+"}}} vim-side completion function
+
+"{{{ ruby-side code
+function! s:DefRuby()
+ruby << RUBYEOF
+# {{{ ruby completion
+
+begin
+ require 'rubygems' # let's assume this is safe...?
+rescue Exception
+ #ignore?
+end
+class VimRubyCompletion
+# {{{ constants
+ @@debug = false
+ @@ReservedWords = [
+ "BEGIN", "END",
+ "alias", "and",
+ "begin", "break",
+ "case", "class",
+ "def", "defined", "do",
+ "else", "elsif", "end", "ensure",
+ "false", "for",
+ "if", "in",
+ "module",
+ "next", "nil", "not",
+ "or",
+ "redo", "rescue", "retry", "return",
+ "self", "super",
+ "then", "true",
+ "undef", "unless", "until",
+ "when", "while",
+ "yield",
+ ]
+
+ @@Operators = [ "%", "&", "*", "**", "+", "-", "/",
+ "<", "<<", "<=", "<=>", "==", "===", "=~", ">", ">=", ">>",
+ "[]", "[]=", "^", ]
+# }}} constants
+
+# {{{ buffer analysis magic
+ def load_requires
+ buf = VIM::Buffer.current
+ enum = buf.line_number
+ nums = Range.new( 1, enum )
+ nums.each do |x|
+ ln = buf[x]
+ begin
+ eval( "require %s" % $1 ) if /.*require\s*(.*)$/.match( ln )
+ rescue Exception
+ #ignore?
+ end
+ end
+ end
+
+ def load_buffer_class(name)
+ dprint "load_buffer_class(%s) START" % name
+ classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")')
+ return if classdef == nil
+
+ pare = /^\s*class\s*(.*)\s*<\s*(.*)\s*\n/.match( classdef )
+ load_buffer_class( $2 ) if pare != nil && $2 != name # load parent class if needed
+
+ mixre = /.*\n\s*include\s*(.*)\s*\n/.match( classdef )
+ load_buffer_module( $2 ) if mixre != nil && $2 != name # load mixins if needed
+
+ begin
+ eval classdef
+ rescue Exception
+ VIM::evaluate( "s:ErrMsg( 'Problem loading class \"%s\", was it already completed?' )" % name )
+ end
+ dprint "load_buffer_class(%s) END" % name
+ end
+
+ def load_buffer_module(name)
+ dprint "load_buffer_module(%s) START" % name
+ classdef = get_buffer_entity(name, 's:GetBufferRubyModule("%s")')
+ return if classdef == nil
+
+ begin
+ eval classdef
+ rescue Exception
+ VIM::evaluate( "s:ErrMsg( 'Problem loading module \"%s\", was it already completed?' )" % name )
+ end
+ dprint "load_buffer_module(%s) END" % name
+ end
+
+ def get_buffer_entity(name, vimfun)
+ loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
+ return nil if loading_allowed != '1'
+ return nil if /(\"|\')+/.match( name )
+ buf = VIM::Buffer.current
+ nums = eval( VIM::evaluate( vimfun % name ) )
+ return nil if nums == nil
+ return nil if nums.min == nums.max && nums.min == 0
+
+ dprint "get_buffer_entity START"
+ visited = []
+ clscnt = 0
+ bufname = VIM::Buffer.current.name
+ classdef = ""
+ cur_line = VIM::Buffer.current.line_number
+ while (nums != nil && !(nums.min == 0 && nums.max == 0) )
+ dprint "visited: %s" % visited.to_s
+ break if visited.index( nums )
+ visited << nums
+
+ nums.each do |x|
+ if x != cur_line
+ next if x == 0
+ ln = buf[x]
+ if /^\s*(module|class|def|include)\s+/.match(ln)
+ clscnt += 1 if $1 == "class"
+ #dprint "\$1: %s" % $1
+ classdef += "%s\n" % ln
+ classdef += "end\n" if /def\s+/.match(ln)
+ dprint ln
+ end
+ end
+ end
+
+ nm = "%s(::.*)*\", %s, \"" % [ name, nums.last ]
+ nums = eval( VIM::evaluate( vimfun % nm ) )
+ dprint "nm: \"%s\"" % nm
+ dprint "vimfun: %s" % (vimfun % nm)
+ dprint "got nums: %s" % nums.to_s
+ end
+ if classdef.length > 1
+ classdef += "end\n"*clscnt
+ # classdef = "class %s\n%s\nend\n" % [ bufname.gsub( /\/|\\/, "_" ), classdef ]
+ end
+
+ dprint "get_buffer_entity END"
+ dprint "classdef====start"
+ lns = classdef.split( "\n" )
+ lns.each { |x| dprint x }
+ dprint "classdef====end"
+ return classdef
+ end
+
+ def get_var_type( receiver )
+ if /(\"|\')+/.match( receiver )
+ "String"
+ else
+ VIM::evaluate("s:GetRubyVarType('%s')" % receiver)
+ end
+ end
+
+ def dprint( txt )
+ print txt if @@debug
+ end
+
+ def get_buffer_entity_list( type )
+ # this will be a little expensive.
+ loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
+ allow_aggressive_load = VIM::evaluate("exists('g:rubycomplete_classes_in_global') && g:rubycomplete_classes_in_global")
+ return [] if allow_aggressive_load != '1' || loading_allowed != '1'
+
+ buf = VIM::Buffer.current
+ eob = buf.length
+ ret = []
+ rg = 1..eob
+ re = eval( "/^\s*%s\s*([A-Za-z0-9_:-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*/" % type )
+
+ rg.each do |x|
+ if re.match( buf[x] )
+ next if type == "def" && eval( VIM::evaluate("s:IsPosInClassDef(%s)" % x) ) != nil
+ ret.push $1
+ end
+ end
+
+ return ret
+ end
+
+ def get_buffer_modules
+ return get_buffer_entity_list( "modules" )
+ end
+
+ def get_buffer_methods
+ return get_buffer_entity_list( "def" )
+ end
+
+ def get_buffer_classes
+ return get_buffer_entity_list( "class" )
+ end
+
+
+ def load_rails
+ allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
+ return if allow_rails != '1'
+
+ buf_path = VIM::evaluate('expand("%:p")')
+ file_name = VIM::evaluate('expand("%:t")')
+ vim_dir = VIM::evaluate('getcwd()')
+ file_dir = buf_path.gsub( file_name, '' )
+ file_dir.gsub!( /\\/, "/" )
+ vim_dir.gsub!( /\\/, "/" )
+ vim_dir << "/"
+ dirs = [ vim_dir, file_dir ]
+ sdirs = [ "", "./", "../", "../../", "../../../", "../../../../" ]
+ rails_base = nil
+
+ dirs.each do |dir|
+ sdirs.each do |sub|
+ trail = "%s%s" % [ dir, sub ]
+ tcfg = "%sconfig" % trail
+
+ if File.exists?( tcfg )
+ rails_base = trail
+ break
+ end
+ end
+ break if rails_base
+ end
+
+ return if rails_base == nil
+ $:.push rails_base unless $:.index( rails_base )
+
+ rails_config = rails_base + "config/"
+ rails_lib = rails_base + "lib/"
+ $:.push rails_config unless $:.index( rails_config )
+ $:.push rails_lib unless $:.index( rails_lib )
+
+ bootfile = rails_config + "boot.rb"
+ envfile = rails_config + "environment.rb"
+ if File.exists?( bootfile ) && File.exists?( envfile )
+ begin
+ require bootfile
+ require envfile
+ begin
+ require 'console_app'
+ require 'console_with_helpers'
+ rescue Exception
+ dprint "Rails 1.1+ Error %s" % $!
+ # assume 1.0
+ end
+ #eval( "Rails::Initializer.run" ) #not necessary?
+ VIM::command('let s:rubycomplete_rails_loaded = 1')
+ dprint "rails loaded"
+ rescue Exception
+ dprint "Rails Error %s" % $!
+ VIM::evaluate( "s:ErrMsg('Error loading rails environment')" )
+ end
+ end
+ end
+
+ def get_rails_helpers
+ allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
+ rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
+ return [] if allow_rails != '1' || rails_loaded != '1'
+
+ buf_path = VIM::evaluate('expand("%:p")')
+ buf_path.gsub!( /\\/, "/" )
+ path_elm = buf_path.split( "/" )
+ dprint "buf_path: %s" % buf_path
+ types = [ "app", "db", "lib", "test", "components", "script" ]
+
+ i = nil
+ ret = []
+ type = nil
+ types.each do |t|
+ i = path_elm.index( t )
+ break if i
+ end
+ type = path_elm[i]
+ type.downcase!
+
+ dprint "type: %s" % type
+ case type
+ when "app"
+ i += 1
+ subtype = path_elm[i]
+ subtype.downcase!
+
+ dprint "subtype: %s" % subtype
+ case subtype
+ when "views"
+ ret += ActionView::Base.instance_methods
+ ret += ActionView::Base.methods
+ when "controllers"
+ ret += ActionController::Base.instance_methods
+ ret += ActionController::Base.methods
+ when "models"
+ ret += ActiveRecord::Base.instance_methods
+ ret += ActiveRecord::Base.methods
+ end
+
+ when "db"
+ ret += ActiveRecord::ConnectionAdapters::SchemaStatements.instance_methods
+ ret += ActiveRecord::ConnectionAdapters::SchemaStatements.methods
+ end
+
+
+ return ret
+ end
+
+ def add_rails_columns( cls )
+ allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
+ rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
+ return [] if allow_rails != '1' || rails_loaded != '1'
+
+ begin
+ eval( "#{cls}.establish_connection" )
+ return [] unless eval( "#{cls}.ancestors.include?(ActiveRecord::Base).to_s" )
+ col = eval( "#{cls}.column_names" )
+ return col if col
+ rescue
+ dprint "add_rails_columns err: (cls: %s) %s" % [ cls, $! ]
+ return []
+ end
+ return []
+ end
+
+ def clean_sel(sel, msg)
+ sel.delete_if { |x| x == nil }
+ sel.uniq!
+ sel.grep(/^#{Regexp.quote(msg)}/) if msg != nil
+ end
+
+ def get_rails_view_methods
+ allow_rails = VIM::evaluate("exists('g:rubycomplete_rails') && g:rubycomplete_rails")
+ rails_loaded = VIM::evaluate('s:rubycomplete_rails_loaded')
+ return [] if allow_rails != '1' || rails_loaded != '1'
+
+ buf_path = VIM::evaluate('expand("%:p")')
+ buf_path.gsub!( /\\/, "/" )
+ pelm = buf_path.split( "/" )
+ idx = pelm.index( "views" )
+
+ return [] unless idx
+ idx += 1
+
+ clspl = pelm[idx].camelize.pluralize
+ cls = clspl.singularize
+
+ ret = []
+ begin
+ ret += eval( "#{cls}.instance_methods" )
+ ret += eval( "#{clspl}Helper.instance_methods" )
+ rescue Exception
+ dprint "Error: Unable to load rails view helpers for %s: %s" % [ cls, $! ]
+ end
+
+ return ret
+ end
+# }}} buffer analysis magic
+
+# {{{ main completion code
+ def self.preload_rails
+ a = VimRubyCompletion.new
+ require 'Thread'
+ Thread.new(a) do |b|
+ begin
+ b.load_rails
+ rescue
+ end
+ end
+ a.load_rails
+ rescue
+ end
+
+ def self.get_completions(base)
+ b = VimRubyCompletion.new
+ b.get_completions base
+ end
+
+ def get_completions(base)
+ loading_allowed = VIM::evaluate("exists('g:rubycomplete_buffer_loading') && g:rubycomplete_buffer_loading")
+ if loading_allowed == '1'
+ load_requires
+ load_rails
+ end
+
+ input = VIM::Buffer.current.line
+ cpos = VIM::Window.current.cursor[1] - 1
+ input = input[0..cpos]
+ input += base
+ input.sub!(/.*[ \t\n\"\\'`><=;|&{(]/, '') # Readline.basic_word_break_characters
+ input.sub!(/self\./, '')
+ input.sub!(/.*((\.\.[\[(]?)|([\[(]))/, '')
+
+ dprint 'input %s' % input
+ message = nil
+ receiver = nil
+ methods = []
+ variables = []
+ classes = []
+ constants = []
+
+ case input
+ when /^(\/[^\/]*\/)\.([^.]*)$/ # Regexp
+ receiver = $1
+ message = Regexp.quote($2)
+ methods = Regexp.instance_methods(true)
+
+ when /^([^\]]*\])\.([^.]*)$/ # Array
+ receiver = $1
+ message = Regexp.quote($2)
+ methods = Array.instance_methods(true)
+
+ when /^([^\}]*\})\.([^.]*)$/ # Proc or Hash
+ receiver = $1
+ message = Regexp.quote($2)
+ methods = Proc.instance_methods(true) | Hash.instance_methods(true)
+
+ when /^(:[^:.]*)$/ # Symbol
+ dprint "symbol"
+ if Symbol.respond_to?(:all_symbols)
+ receiver = $1
+ message = $1.sub( /:/, '' )
+ methods = Symbol.all_symbols.collect{|s| s.id2name}
+ methods.delete_if { |c| c.match( /'/ ) }
+ end
+
+ when /^::([A-Z][^:\.\(]*)$/ # Absolute Constant or class methods
+ dprint "const or cls"
+ receiver = $1
+ methods = Object.constants
+ methods.grep(/^#{receiver}/).collect{|e| "::" + e}
+
+ when /^(((::)?[A-Z][^:.\(]*)+)::?([^:.]*)$/ # Constant or class methods
+ receiver = $1
+ message = Regexp.quote($4)
+ dprint "const or cls 2 [recv: \'%s\', msg: \'%s\']" % [ receiver, message ]
+ load_buffer_class( receiver )
+ begin
+ classes = eval("#{receiver}.constants")
+ #methods = eval("#{receiver}.methods")
+ rescue Exception
+ dprint "exception: %s" % $!
+ methods = []
+ end
+ methods.grep(/^#{message}/).collect{|e| receiver + "::" + e}
+
+ when /^(:[^:.]+)\.([^.]*)$/ # Symbol
+ dprint "symbol"
+ receiver = $1
+ message = Regexp.quote($2)
+ methods = Symbol.instance_methods(true)
+
+ when /^([0-9_]+(\.[0-9_]+)?(e[0-9]+)?)\.([^.]*)$/ # Numeric
+ dprint "numeric"
+ receiver = $1
+ message = Regexp.quote($4)
+ begin
+ methods = eval(receiver).methods
+ rescue Exception
+ methods = []
+ end
+
+ when /^(\$[^.]*)$/ #global
+ dprint "global"
+ methods = global_variables.grep(Regexp.new(Regexp.quote($1)))
+
+ when /^((\.?[^.]+)+)\.([^.]*)$/ # variable
+ dprint "variable"
+ receiver = $1
+ message = Regexp.quote($3)
+ load_buffer_class( receiver )
+
+ cv = eval("self.class.constants")
+ vartype = get_var_type( receiver )
+ dprint "vartype: %s" % vartype
+ if vartype != ''
+ load_buffer_class( vartype )
+
+ begin
+ methods = eval("#{vartype}.instance_methods")
+ variables = eval("#{vartype}.instance_variables")
+ rescue Exception
+ dprint "load_buffer_class err: %s" % $!
+ end
+ elsif (cv).include?(receiver)
+ # foo.func and foo is local var.
+ methods = eval("#{receiver}.methods")
+ vartype = receiver
+ elsif /^[A-Z]/ =~ receiver and /\./ !~ receiver
+ vartype = receiver
+ # Foo::Bar.func
+ begin
+ methods = eval("#{receiver}.methods")
+ rescue Exception
+ end
+ else
+ # func1.func2
+ ObjectSpace.each_object(Module){|m|
+ next if m.name != "IRB::Context" and
+ /^(IRB|SLex|RubyLex|RubyToken)/ =~ m.name
+ methods.concat m.instance_methods(false)
+ }
+ end
+ variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0
+
+ when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/
+ message = $1
+ methods = Range.instance_methods(true)
+
+ when /^\.([^.]*)$/ # unknown(maybe String)
+ message = Regexp.quote($1)
+ methods = String.instance_methods(true)
+
+ else
+ dprint "default/other"
+ inclass = eval( VIM::evaluate("s:IsInClassDef()") )
+
+ if inclass != nil
+ dprint "inclass"
+ classdef = "%s\n" % VIM::Buffer.current[ inclass.min ]
+ found = /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*\n$/.match( classdef )
+
+ if found != nil
+ receiver = $1
+ message = input
+ load_buffer_class( receiver )
+ begin
+ methods = eval( "#{receiver}.instance_methods" )
+ variables += add_rails_columns( "#{receiver}" )
+ rescue Exception
+ found = nil
+ end
+ end
+ end
+
+ if inclass == nil || found == nil
+ dprint "inclass == nil"
+ methods = get_buffer_methods
+ methods += get_rails_view_methods
+
+ cls_const = Class.constants
+ constants = cls_const.select { |c| /^[A-Z_-]+$/.match( c ) }
+ classes = eval("self.class.constants") - constants
+ classes += get_buffer_classes
+ classes += get_buffer_modules
+
+ include_objectspace = VIM::evaluate("exists('g:rubycomplete_include_objectspace') && g:rubycomplete_include_objectspace")
+ ObjectSpace.each_object(Class) { |cls| classes << cls.to_s } if include_objectspace == "1"
+ message = receiver = input
+ end
+
+ methods += get_rails_helpers
+ methods += Kernel.public_methods
+ end
+
+
+ include_object = VIM::evaluate("exists('g:rubycomplete_include_object') && g:rubycomplete_include_object")
+ methods = clean_sel( methods, message )
+ methods = (methods-Object.instance_methods) if include_object == "0"
+ rbcmeth = (VimRubyCompletion.instance_methods-Object.instance_methods) # lets remove those rubycomplete methods
+ methods = (methods-rbcmeth)
+
+ variables = clean_sel( variables, message )
+ classes = clean_sel( classes, message ) - ["VimRubyCompletion"]
+ constants = clean_sel( constants, message )
+
+ valid = []
+ valid += methods.collect { |m| { :name => m, :type => 'm' } }
+ valid += variables.collect { |v| { :name => v, :type => 'v' } }
+ valid += classes.collect { |c| { :name => c, :type => 't' } }
+ valid += constants.collect { |d| { :name => d, :type => 'd' } }
+ valid.sort! { |x,y| x[:name] <=> y[:name] }
+
+ outp = ""
+
+ rg = 0..valid.length
+ rg.step(150) do |x|
+ stpos = 0+x
+ enpos = 150+x
+ valid[stpos..enpos].each { |c| outp += "{'word':'%s','item':'%s','kind':'%s'}," % [ c[:name], c[:name], c[:type] ] }
+ outp.sub!(/,$/, '')
+
+ VIM::command("call extend(g:rubycomplete_completions, [%s])" % outp)
+ outp = ""
+ end
+ end
+# }}} main completion code
+
+end # VimRubyCompletion
+# }}} ruby completion
+RUBYEOF
+endfunction
+
+let s:rubycomplete_rails_loaded = 0
+
+call s:DefRuby()
+"}}} ruby-side code
+
+
+" vim:tw=78:sw=4:ts=8:et:fdm=marker:ft=vim:norl:
392 autoload/snipMate.vim
@@ -0,0 +1,392 @@
+fun! Filename(...)
+ let filename = expand('%:t:r')
+ if filename == '' | return a:0 == 2 ? a:2 : '' | endif
+ return !a:0 || a:1 == '' ? filename : substitute(a:1, '$1', filename, 'g')
+endf
+
+fun s:RemoveSnippet()
+ unl g:snipPos s:curPos s:snipLen s:endSnip s:endSnipLine s:prevLen
+endf
+
+fun snipMate#expandSnip(snip, col)
+ let lnum = line('.') | let col = a:col
+
+ let snippet = s:ProcessSnippet(a:snip)
+ if snippet == '' | return '' | endif
+
+ let snipLines = split(substitute(snippet, '$\d\+\|${\d\+.\{-}}', '', 'g'), "\n", 1)
+
+ let line = getline(lnum)
+ let afterCursor = strpart(line, col - 1)
+ if afterCursor != "\t" && afterCursor != ' '
+ let line = strpart(line, 0, col - 1)
+ let snipLines[-1] .= afterCursor
+ else
+ let afterCursor = ''
+ " For some reason the cursor needs to move one right after this
+ if line != '' && col == 1 && &ve != 'all' && &ve != 'onemore'
+ let col += 1
+ endif
+ endif
+
+ call setline(lnum, line.snipLines[0])
+
+ " Autoindent snippet according to previous indentation
+ let indent = matchend(line, '^.\{-}\ze\(\S\|$\)') + 1
+ call append(lnum, map(snipLines[1:], "'".strpart(line, 0, indent - 1)."'.v:val"))
+ if &fen | sil! exe lnum.','.(lnum + len(snipLines) - 1).'foldopen' | endif
+
+ let [g:snipPos, s:snipLen] = s:BuildTabStops(snippet, lnum, col - indent, indent)
+
+ if s:snipLen
+ let s:curPos = 0
+ let s:endSnip = g:snipPos[s:curPos][1]
+ let s:endSnipLine = g:snipPos[s:curPos][0]
+
+ call cursor(g:snipPos[s:curPos][0], g:snipPos[s:curPos][1])
+ let s:prevLen = [line('$'), col('$')]
+ if g:snipPos[s:curPos][2] != -1 | return s:SelectWord() | endif
+ else
+ unl g:snipPos s:snipLen
+ " Place cursor at end of snippet if no tab stop is given
+ let newlines = len(snipLines) - 1
+ call cursor(lnum + newlines, indent + len(snipLines[-1]) - len(afterCursor)
+ \ + (newlines ? 0: col - 1))
+ endif
+ return ''
+endf
+
+fun s:ProcessSnippet(snip)
+ let snippet = a:snip
+ " Evaluate eval (`...`) expressions.
+ " Using a loop here instead of a regex fixes a bug with nested "\=".
+ if stridx(snippet, '`') != -1
+ while match(snippet, '`.\{-}`') != -1
+ let snippet = substitute(snippet, '`.\{-}`',
+ \ substitute(eval(matchstr(snippet, '`\zs.\{-}\ze`')),
+ \ "\n\\%$", '', ''), '')
+ endw
+ let snippet = substitute(snippet, "\r", "\n", 'g')
+ endif
+
+ " Place all text after a colon in a tab stop after the tab stop
+ " (e.g. "${#:foo}" becomes "${:foo}foo").
+ " This helps tell the position of the tab stops later.
+ let snippet = substitute(snippet, '${\d\+:\(.\{-}\)}', '&\1', 'g')
+
+ " Update the a:snip so that all the $# become the text after
+ " the colon in their associated ${#}.
+ " (e.g. "${1:foo}" turns all "$1"'s into "foo")
+ let i = 1
+ while stridx(snippet, '${'.i) != -1
+ let s = matchstr(snippet, '${'.i.':\zs.\{-}\ze}')
+ if s != ''
+ let snippet = substitute(snippet, '$'.i, s.'&', 'g')
+ endif
+ let i += 1
+ endw
+
+ if &et " Expand tabs to spaces if 'expandtab' is set.
+ return substitute(snippet, '\t', repeat(' ', &sts ? &sts : &sw), 'g')
+ endif
+ return snippet
+endf
+
+fun s:Count(haystack, needle)
+ let counter = 0
+ let index = stridx(a:haystack, a:needle)
+ while index != -1
+ let index = stridx(a:haystack, a:needle, index+1)
+ let counter += 1
+ endw
+ return counter
+endf
+
+" This function builds a list of a list of each tab stop in the
+" snippet containing:
+" 1.) The tab stop's line number.
+" 2.) The tab stop's column number
+" (by getting the length of the string between the last "\n" and the
+" tab stop).
+" 3.) The length of the text after the colon for the current tab stop
+" (e.g. "${1:foo}" would return 3). If there is no text, -1 is returned.
+" 4.) If the "${#:}" construct is given, another list containing all
+" the matches of "$#", to be replaced with the placeholder. This list is
+" composed the same way as the parent; the first item is the line number,
+" and the second is the column.
+fun s:BuildTabStops(snip, lnum, col, indent)
+ let snipPos = []
+ let i = 1
+ let withoutVars = substitute(a:snip, '$\d\+', '', 'g')
+ while stridx(a:snip, '${'.i) != -1
+ let beforeTabStop = matchstr(withoutVars, '^.*\ze${'.i.'\D')
+ let withoutOthers = substitute(withoutVars, '${\('.i.'\D\)\@!\d\+.\{-}}', '', 'g')
+
+ let j = i - 1
+ call add(snipPos, [0, 0, -1])
+ let snipPos[j][0] = a:lnum + s:Count(beforeTabStop, "\n")
+ let snipPos[j][1] = a:indent + len(matchstr(withoutOthers, '.*\(\n\|^\)\zs.*\ze${'.i.'\D'))
+ if snipPos[j][0] == a:lnum | let snipPos[j][1] += a:col | endif
+
+ " Get all $# matches in another list, if ${#:name} is given
+ if stridx(withoutVars, '${'.i.':') != -1
+ let snipPos[j][2] = len(matchstr(withoutVars, '${'.i.':\zs.\{-}\ze}'))
+ let dots = repeat('.', snipPos[j][2])
+ call add(snipPos[j], [])
+ let withoutOthers = substitute(a:snip, '${\d\+.\{-}}\|$'.i.'\@!\d\+', '', 'g')
+ while match(withoutOthers, '$'.i.'\D') != -1
+ let beforeMark = matchstr(withoutOthers, '^.\{-}\ze'.dots.'$'.i.'\D')
+ call add(snipPos[j][3], [0, 0])
+ let snipPos[j][3][-1][0] = a:lnum + s:Count(beforeMark, "\n")
+ let snipPos[j][3][-1][1] = a:indent + (snipPos[j][3][-1][0] > a:lnum
+ \ ? len(matchstr(beforeMark, '.*\n\zs.*'))
+ \ : a:col + len(beforeMark))
+ let withoutOthers = substitute(withoutOthers, '$'.i.'\ze\D', '', '')
+ endw
+ endif
+ let i += 1
+ endw
+ return [snipPos, i - 1]
+endf
+
+fun snipMate#jumpTabStop()
+ if exists('s:update')
+ call s:UpdatePlaceholderTabStops()
+ else
+ call s:UpdateTabStops()
+