CSApprox.txt 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. *CSApprox.txt* Bringing GVim colorschemes to the terminal!
  2. *csapprox* *csapprox.vim*
  3. _____ ____ ___ ~
  4. / ___// __// _ | ___ ___ ____ ___ __ __ ~
  5. / /__ _\ \ / __ | / _ \ / _ \ / __// _ \ \ \ / ~
  6. \___//___//_/ |_|/ .__// .__//_/ \___//_\_\ ~
  7. /_/ /_/ ~
  8. For Vim version 7.0 or newer
  9. Last changed 01 Apr 2009
  10. By Matt Wozniski
  11. mjw@drexel.edu
  12. Reference Manual~
  13. *csapprox-toc*
  14. 1. Introduction |csapprox-intro|
  15. 2. Requirements |csapprox-requirements|
  16. 3. Configuration |csapprox-configure|
  17. 4. Rationale/Design |csapprox-design|
  18. 5. Known Bugs and Limitations |csapprox-limitations|
  19. 6. Appendix - Terminals and Palettes |csapprox-terminal-list|
  20. 7. Changelog |csapprox-changelog|
  21. 8. Contact Info |csapprox-author|
  22. The functionality mentioned here is a plugin, see |add-plugin|.
  23. You can avoid loading this plugin by setting the "CSApprox_loaded" global
  24. variable in your |vimrc| file: >
  25. :let g:CSApprox_loaded = 1
  26. ==============================================================================
  27. 1. Introduction *csapprox-intro*
  28. It's hard to find colorschemes for terminal Vim. Most colorschemes are
  29. written to only support GVim, and don't work at all in terminal Vim.
  30. This plugin makes GVim-only colorschemes Just Work in terminal Vim, as long
  31. as the terminal supports 88 or 256 colors - and most do these days. This
  32. usually requires no user interaction (but see below for what to do if things
  33. don't Just Work). After getting this plugin happily installed, any time you
  34. use :colorscheme it will do its magic and make the colorscheme Just Work.
  35. Whenever you change colorschemes using the :colorscheme command this script
  36. will be executed. It will take the colors that the scheme specified for use
  37. in the GUI and use an approximation algorithm to try to gracefully degrade
  38. them to the closest color available in your terminal. If you are running in
  39. a GUI or if your terminal doesn't support 88 or 256 colors, no changes are
  40. made. Also, no changes will be made if the colorscheme seems to have been
  41. high color already.
  42. If for some reason this transparent method isn't suitable to you (for instance
  43. if your environment can't be configured to meet the |csapprox-requirements|,
  44. or you need to work in Vim 6), another option is also available: using the
  45. |:CSApproxSnapshot| command to create a new GUI/88-/256-color terminal
  46. colorscheme. To use this command, a user would generally start GVim, choose a
  47. colorscheme that sets up the desired colors, and then use |:CSApproxSnapshot|
  48. to create a new colorscheme based on those colors that works in high color
  49. terminals. This method is more flexible than the transparent mode and works
  50. in more places, but also requires more user intervention, and makes it harder
  51. to deal with colorschemes being updated and such.
  52. *:CSApproxSnapshot*
  53. The full syntax for the command is: >
  54. :CSApproxSnapshot[!] /path/to/new/colorscheme
  55. < For example: >
  56. :CSApproxSnapshot ~/.vim/colors/foobar.vim
  57. <
  58. NOTE: The generated colorscheme will only work in 88- and 256-color terminals,
  59. and in GVim. It will not work at all in a terminal with 16 or fewer
  60. colors. There's just no reliable way to approximate down from
  61. 16,777,216 colors to 16 colors, especially without there being any
  62. standard for what those 16 colors look like other than 'orange-ish',
  63. 'red-ish', etc.
  64. NOTE: Although :CSApproxSnapshot can be used in both GVim and terminal Vim,
  65. the resulting colors might be slightly off when run from terminal Vim.
  66. I can find no way around this; Vim internally sets different colors when
  67. running in a terminal than running in the GUI, and there's no way for
  68. terminal Vim to figure out what color would have been used in GVim.
  69. ==============================================================================
  70. 2. Requirements *csapprox-requirements*
  71. For CSApprox to work, there are 2 major requirements that must be met.
  72. a) GUI support *csapprox-gui-support* *csapprox-+gui*
  73. If CSApprox is being used to adjust a scheme's colors transparently, then the
  74. terminal "vim" binary that is being run must be built with GUI support (see
  75. |csapprox-limitations| for an explanation). If |:CSApproxSnapshot| is being
  76. used to create a terminal colorscheme for high color terminals, then the
  77. "vim" binary being used to create the scheme must be built with +gui, but the
  78. scheme can be used in terminal "vim" binaries that weren't built with +gui.
  79. NOTE that creating snapshots with GVim will work better than making them with
  80. Vim, and (obviously) all "gvim" binaries are built with +gui.
  81. Unfortunately, several Linux distributions only include GUI support in their
  82. "gvim" binary, and not in their "vim" binary. You can check if GUI support is
  83. available with the following command:
  84. :echo has('gui')
  85. If that prints 0, the first thing to try would be searching for a larger vim
  86. package provided by your distribution, like "vim-enhanced" on RedHat/CentOS
  87. or "vim-gtk" or "vim-gnome" on Debian/Ubuntu.
  88. If you are unable to obtain a "vim" binary that includes GUI support, but
  89. have a "gvim" binary available, you can probably launch Vim with GUI support
  90. anyway by calling gvim with the |-v| flag in the shell: >
  91. gvim -v
  92. If the above works, you can remove the need to call "gvim -v" instead of "vim"
  93. all the time by creating a symbolic link from your "gvim" binary to "vim"
  94. somewhere in your $PATH, for example:
  95. sudo ln -s $(which gvim) $(which vim)
  96. If launching as "gvim -v" doesn"t work, and no package with GUI support is
  97. available, you will need to compile Vim yourself and ensure that GUI support
  98. is included to use CSApprox in its transparent mode, or create a snapshotted
  99. scheme from GVim to use its snapshot mode. If this is inconvenient for you,
  100. make sure that the Vim maintainer for your distribution knows it; they made a
  101. conscious decision to build "vim" without +gui and "gvim" without terminal
  102. support.
  103. b) Properly configured terminal *csapprox-terminal*
  104. As said above, many modern terminals support 88 or 256 colors, but most of
  105. these default to setting $TERM to something generic (usually "xterm"). Since
  106. Vim uses the value of the "colors" attribute for the current $TERM in terminfo
  107. to figure out the number of colors used internally as 't_Co', this plugin will
  108. either need for 't_Co' to be set to 88 or 256 in |vimrc|, or for $TERM to be
  109. set to something that implies high color support. Possible choices include
  110. "xterm-256color" for 256 color support and "rxvt-unicode" for 88 color
  111. support.
  112. *csapprox-palettes*
  113. Also, there are three different 256 color cube palettes available and CSApprox
  114. has no way to tell which you're using unless $TERM is set to something that is
  115. specific to the terminal, like "konsole-256color" or "Eterm". Because of this, the
  116. most sane behavior is assuming the user is using the most popular palette,
  117. which is used by all but Konsole and Eterm, whenever $TERM is set to something
  118. generic like "xterm" or "screen". You can override this default, however -
  119. see |csapprox-configure|.
  120. *csapprox-terminal-example*
  121. To turn on high color support without fixing $TERM, you can change t_Co in
  122. your .vimrc, and set either CSApprox_konsole or CSApprox_eterm if appropriate.
  123. One way would be to put something like this into your |vimrc|:
  124. >
  125. if (&term == 'xterm' || &term =~? '^screen') && hostname() == 'my-machine'
  126. " On my machine, I use Konsole with 256 color support
  127. set t_Co=256
  128. let g:CSApprox_konsole = 1
  129. endif
  130. Gnome Terminal, as of the time that I am writing this, doesn't support having
  131. the terminal emulator set $TERM to something adequately descriptive. In cases
  132. like this, something like the following would be appropriate:
  133. >
  134. if &term =~ '^\(xterm\|screen\)$' && $COLORTERM == 'gnome-terminal'
  135. set t_Co=256
  136. endif
  137. ==============================================================================
  138. 3. Configuration *csapprox-configure*
  139. There are several global variables that can be set to configure the behavior
  140. of CSApprox. They are listed roughly based on the likelihood that the end
  141. user might want to know about them.
  142. g:CSApprox_loaded *g:CSApprox_loaded*
  143. If set in your |vimrc|, CSApprox is not loaded. Has no effect on
  144. snapshotted schemes.
  145. g:CSApprox_verbose_level *g:CSApprox_verbose_level*
  146. When CSApprox is run, the 'verbose' option will be temporarily raised to
  147. the value held in this variable unless it is already greater. The default
  148. value is 1, which allows CSApprox to default to warning whenever something
  149. is wrong, even if it is recoverable, but allows the user to quiet us if he
  150. wants by changing this variable to 0. The most important messages will be
  151. shown at verbosity level 1; some less important ones will be shown at
  152. higher verbosity levels. Has no effect on snapshotted schemes.
  153. g:CSApprox_eterm *g:CSApprox_eterm*
  154. If set to a non-zero number, CSApprox will use the Eterm palette when
  155. 'term' is set to "xterm" or begins with "screen". Otherwise, the xterm
  156. palette would be used. This also affects snapshotted schemes.
  157. g:CSApprox_konsole *g:CSApprox_konsole*
  158. If set to a non-zero number, CSApprox will use the Konsole palette when
  159. 'term' is set to "xterm" or begins with "screen". Otherwise, the xterm
  160. palette would be used. This also affects snapshotted schemes.
  161. g:CSApprox_attr_map *g:CSApprox_attr_map*
  162. Since some attributes (like 'guisp') can't be used in a terminal, and
  163. others (like 'italic') are often very ugly in terminals, a generic way to
  164. map between a requested attribute and another attribute is included. This
  165. variable should be set to a Dictionary, where the keys are strings
  166. representing the attributes the author wanted set, and the values are the
  167. strings that the user wants set instead. If a value is '', it means the
  168. attribute should just be ignored. The default is to replace 'italic' with
  169. 'underline', and to use 'fg' instead of 'sp': >
  170. let g:CSApprox_attr_map = { 'italic' : 'underline', 'sp' : 'fg' }
  171. <
  172. Your author prefers disabling bold and italic entirely, so uses this: >
  173. let g:CSApprox_attr_map = { 'bold' : '', 'italic' : '', 'sp' : 'fg' }
  174. <
  175. Note: This transformation is considered at the time a snapshotted scheme
  176. is created, rather than when it is used.
  177. Note: You can only map an attribute representing a color to another
  178. attribute representing a color; likewise with boolean attributes.
  179. After all, sp -> bold and italic -> fg would be nonsensical.
  180. *g:CSApprox_hook_pre* *g:CSApprox_hook_{scheme}_pre*
  181. *g:CSApprox_hook_post* *g:CSApprox_hook_{scheme}_post*
  182. g:CSApprox_hook_pre
  183. g:CSApprox_hook_post
  184. g:CSApprox_hook_{scheme}_pre
  185. g:CSApprox_hook_{scheme}_post *csapprox-hooks*
  186. These variables provide a method for adjusting tweaking the approximation
  187. algorithm, either for all schemes, or on a per scheme basis. For
  188. snapshotted schemes, these will only take effect when the snapshotted
  189. scheme is created, rather than when it is used. Each of these variables
  190. may be set to either a String containing a command to be :execute'd, or a
  191. List of such Strings. The _pre hooks are executed before any
  192. approximations have been done. In order to affect the approximation at
  193. this stage, you would need to change the gui colors for a group; the cterm
  194. colors will then be approximated from those gui colors. Example:
  195. >
  196. let g:CSApprox_hook_pre = 'hi Comment guibg=#ffddff'
  197. <
  198. The advantage to tweaking the colors at this stage is that CSApprox will
  199. handle approximating the given gui colors to the proper cterm colors,
  200. regardless of the number of colors the terminal supports. The
  201. disadvantage is that certain things aren't possible, including clearing
  202. the background or foreground color for a group, selecting a precise cterm
  203. color to be used, and overriding the mappings made by g:CSApprox_attr_map.
  204. Another notable disadvantage is that overriding things at this level will
  205. actually affect the gui colors, in case the :gui is used to start gvim
  206. from the running vim instance.
  207. To overcome these disadvantages, the _post hooks are provided. These
  208. hooks will be executed only after all approximations have been completed.
  209. At this stage, in order to have changes appear the cterm* colors must be
  210. modified. For example:
  211. *csapprox-transparency*
  212. >
  213. let g:CSApprox_hook_post = ['hi Normal ctermbg=NONE ctermfg=NONE',
  214. \ 'hi NonText ctermbg=NONE ctermfg=NONE' ]
  215. <
  216. Setting g:CSApprox_hook_post as shown above will clear the background of
  217. the Normal and NonText groups, forcing the terminal's default background
  218. color to be used instead, including any pseudotransparency done by that
  219. terminal emulator. As noted, though, the _post functions do not allow
  220. CSApprox to approximate the colors. This may be desired, but if this is
  221. an inconvenience the function named by g:CSApprox_approximator_function
  222. can still be called manually. For example:
  223. >
  224. let g:CSApprox_hook_post = 'exe "hi Comment ctermbg="'
  225. \ . '. g:CSApprox_approximator_function(0xA0,0x50,0x35)'
  226. <
  227. The _{scheme}_ versions are exactly like their counterparts, except that
  228. they will only be executed if the value of g:colors_name matches the
  229. scheme name embedded in the variable name. They will be executed after
  230. the corresponding hook without _{scheme}_, which provides a way to
  231. override a less specific hook with a more specific one. For example, to
  232. clear the Normal and NonText groups, but only for the colorscheme
  233. "desert", one could do the following:
  234. >
  235. let g:CSApprox_hook_desert_post = ['hi Normal ctermbg=NONE ctermfg=NONE',
  236. \ 'hi NonText ctermbg=NONE ctermfg=NONE' ]
  237. <
  238. One final example: If you want CSApprox to be active for nearly all
  239. colorschemes, but want one or two particular schemes to be ignored, you
  240. can take advantage of the CSApprox logic that skips over any color scheme
  241. that is already high color by setting a color to a number above 255. Note
  242. that most colors greater than 15 will work, but some will not - 256 should
  243. always work. For instance, you can prevent CSApprox from modifying the
  244. colors of the zellner colorscheme like this:
  245. >
  246. let g:CSApprox_hook_zellner_pre = 'hi _FakeGroup ctermbg=256'
  247. <
  248. NOTE: Any characters that would stop the string stored in g:colors_name
  249. from being a valid variable name will be removed before the
  250. _{scheme}_ hook is searched. Basically, this means that first all
  251. characters that are neither alphanumeric nor underscore will be
  252. removed, then any leading digits will be removed. So, for a
  253. colorscheme named "123 foo_bar-baz456.vim", the hook searched for
  254. will be, eg, g:CSApprox_hook_foo_barbaz456_post
  255. g:CSApprox_use_showrgb *g:CSApprox_use_showrgb*
  256. By default, CSApprox will use a built in mapping of color names to values.
  257. This optimization greatly helps speed, but means that colors addressed by
  258. name might not match up perfectly between gvim (which uses the system's
  259. real rgb database) and CSApprox (which uses the builtin database). To
  260. force CSApprox to try the systemwide database first, and only fall back on
  261. the builtin database if it isn't available, set this variable non-zero.
  262. g:CSApprox_approximator_function *g:CSApprox_approximator_function*
  263. If the default approximation function doesn't work well enough, the user
  264. (or another author wishing to extend this plugin) can write another
  265. approximation function. This function should take three numbers,
  266. representing r, g, and b in decimal, and return the index on the color
  267. cube that best matches those colors. Assigning a |Funcref| to this
  268. variable will override the default approximator with the one the Funcref
  269. references. This option will take effect at the time a snapshotted scheme
  270. is created, rather than when it's used.
  271. g:CSApprox_redirfallback *g:CSApprox_redirfallback*
  272. Until Vim 7.2.052, there was a bug in the Vim function synIDattr() that
  273. made it impossible to determine syntax information about the |guisp|
  274. attribute. CSApprox includes a workaround for this problem, as well as a
  275. test that ought to disable this workaround if synIDattr() works properly.
  276. If this test should happen to give improper results somehow, the user can
  277. force the behavior with this variable. When set to 1, the workaround will
  278. always be used, and when set to 0, synIDattr() is blindly used. Needless
  279. to say, if this automatic detection should ever fail, the author would
  280. like to be notified! This option will take effect at the time a
  281. snapshotted scheme is created, rather than when it's used.
  282. ==============================================================================
  283. 4. Rationale/Design *csapprox-design*
  284. There is a wealth of colorschemes available for Vim. Unfortunately, since
  285. traditional terminal emulators have only supported 2, 8 or 16 colors,
  286. colorscheme authors have tended to avoid writing colorschemes for terminal
  287. Vim, sticking instead to GVim. Even now that nearly every popular terminal
  288. supports either 88 or 256 colors, few colorschemes are written to support
  289. them. This may be because the terminal color codes are just numbers from 0 to
  290. 87 or 255 with no semantic meaning, or because the same number doesn't yield
  291. the same color in all terminals, or simply because the colorscheme author
  292. doesn't use the terminal and doesn't want to take the time to support
  293. terminals.
  294. Whatever the reason, this leaves users of many modern terminal emulators in
  295. the awkward position of having a terminal emulator that supports many colors,
  296. but having very few colorschemes that were written to utilize those colors.
  297. This is where CSApprox comes in. It attempts to fill this void allowing GVim
  298. colorschemes to be used in terminal Vim. CSApprox has two distinct modes of
  299. operation. In the first mode, it attempts to make GVim colorschemes
  300. transparently backwards compatible with terminal Vim in a high color terminal.
  301. Basically, whenever a colorscheme is run it should set some colors for the
  302. GUI, and this script will then run and attempt to figure out the closest color
  303. available in the terminal's color palette to the color the scheme author asked
  304. for. Unfortunately, this does not work well all the time, and it has some
  305. limitations (see |csapprox-limitations|). Most of the time, however, this
  306. gives a very close approximation to the GVim colors without requiring any
  307. changes to the colorscheme, or any user interaction. It only requires that
  308. the plugin be installed on the machine where Vim is being run, and that the
  309. user's environment meets the needs specified at |csapprox-requirements|. In
  310. the event that this doesn't work, a second option - using :CSApproxSnapshot
  311. to create a new, 88-/256-color capable colorscheme - is available.
  312. Ideally, the aim is for CSApprox to be completely transparent to the user.
  313. This is why the approach I take is entirely different from the GuiColorScheme
  314. script, which will break on any but the simplest colorschemes. Unfortunately,
  315. given the difficulty of determining exactly which terminal emulator the user
  316. is running, and what features it supports, and which color palette it's using,
  317. perfect transparency is difficult. So, to this end, I've attempted to default
  318. to settings that make it unlikely that this script ever makes things worse
  319. (this is why I chose not to override t_Co to 256 myself), and I've attempted
  320. to make it easy to override my choice of defaults when necessary (through
  321. g:CSApprox_approximator_function, g:CSApprox_konsole, g:CSApprox_eterm,
  322. g:CSApprox_attr_map, etc).
  323. In the event that the transparent solution is undesirable, or that the user's
  324. environment can't be configured to allow it (no GVim and no Vim with +gui, for
  325. instance), |:CSApproxSnapshot| should provide a workable alternative - less
  326. cool, and less flexible, but it will work in more environments, and the
  327. snapshotted colorscheme will even work in Vim 6.
  328. If any of my design choices seem to be causing extra work with no real
  329. advantages, though, I'd like to hear about it. Feel free to email me with any
  330. improvements or complaints.
  331. ==============================================================================
  332. 5. Known Bugs and Limitations *csapprox-limitations*
  333. GUI support is required for transparently adapting schemes.
  334. There is nothing I can do about this given my chosen design. CSApprox works
  335. by being notified every time a colorscheme sets some GUI colors, then
  336. approximating those colors to similar terminal colors. Unfortunately, when
  337. Vim is not built with GUI support, it doesn't bother to store the GUI
  338. colors, so querying for them fails. This leaves me completely unable to
  339. tell what the colorscheme was trying to do. See |csapprox-+gui| for some
  340. potential workarounds if your distribution doesn't provide a Vim with +gui.
  341. User intervention is sometimes required for information about the terminal.
  342. This is really an insurmountable problem. Unfortunately, most terminal
  343. emulators default to setting $TERM to 'xterm', even when they're not really
  344. compatible with an xterm. $TERM is really the only reliable way to
  345. find anything at all out about the terminal you're running in, so there's no
  346. way to know if the terminal supports 88 or 256 colors without either the
  347. terminal telling me (using $TERM) or the user telling me (using 't_Co').
  348. Similarly, unless $TERM is set to something that implies a certain color
  349. palette ought to be used, there's no way for me to know, so I'm forced to
  350. default to the most common, xterm's palette, and allow the user to override
  351. my choice with |g:CSApprox_konsole| or |g:CSApprox_eterm|. An example of
  352. configuring Vim to work around a terminal where $TERM is set to something
  353. generic without configuring the terminal properly is shown at
  354. |csapprox-terminal-example|.
  355. Some colorschemes could fail to be converted if they try to be too smart.
  356. A colorscheme could decide to only set colors for the mode Vim is running
  357. in. If a scheme only sets GUI colors when the GUI is running, instead of
  358. using the usual approach of setting all colors and letting Vim choose which
  359. to use, my approach falls apart. My method for figuring out what the scheme
  360. author wants the scheme to look like absolutely depends upon him setting the
  361. GUI colors in all modes. Fortunately, the few colorschemes that do this
  362. seem to be, by and large, intended for 256 color terminals already, meaning
  363. that skipping them is the proper behavior. Note that this will only affect
  364. transparently adapted schemes and snapshots made from terminal Vim;
  365. snapshots made from GVim are immune to this problem.
  366. Transparently adapting schemes is slow.
  367. For me, it takes Vim's startup time from 0.15 seconds to 0.35 seconds. This
  368. is probably still acceptable, but it is definitely worth trying to cut down
  369. on this time in future versions. Snapshotted schemes are faster to use,
  370. since all of the hard evaluations are made when they're made instead of when
  371. they're used.
  372. NOTE: As of CSApprox 3.50, the overhead is down to about 0.10 seconds on my
  373. test machine.
  374. ==============================================================================
  375. 6. Appendix - Terminals and Palettes *csapprox-terminal-list*
  376. What follows is a list of terminals known to have and known not to have high
  377. color support. This list is certainly incomplete; feel free to contact me
  378. with more to add to either list.
  379. *csapprox-terminals-good*
  380. ------------------------------- Good Terminals -------------------------------
  381. The most recent versions of each of these terminals can be compiled with
  382. either 88 or 256 color support.
  383. *csapprox-xterm*
  384. xterm:
  385. 256 color palette
  386. Colors composed of: [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ]
  387. Greys composed of: [ 0x08, 0x12, 0x1C, 0x26, 0x30, 0x3A, 0x44, 0x4E,
  388. 0x58, 0x62, 0x6C, 0x76, 0x80, 0x8A, 0x94, 0x9E,
  389. 0xA8, 0xB2, 0xBC, 0xC6, 0xD0, 0xDA, 0xE4, 0xEE ]
  390. *csapprox-urxvt*
  391. rxvt-unicode (urxvt):
  392. 88 colors by default (but a patch is available to use xterm's palette)
  393. Colors composed of: [ 0x00, 0x8B, 0xCD, 0xFF ]
  394. Greys composed of: [ 0x2E, 0x5C, 0x73, 0x8B, 0xA2, 0xB9, 0xD0, 0xE7 ]
  395. *csapprox-pterm* *csapprox-putty*
  396. PuTTY (pterm; putty.exe):
  397. 256 colors; same palette as xterm
  398. *csapprox-mrxvt*
  399. Mrxvt (mrxvt):
  400. 256 colors; same palette as xterm
  401. *csapprox-gnome-terminal*
  402. GNOME Terminal (gnome-terminal):
  403. 256 colors; same palette as xterm
  404. *csapprox-roxterm*
  405. ROXTerm (roxterm):
  406. 256 colors; same palette as xterm
  407. *csapprox-xfce4-terminal*
  408. Terminal (xfce4-terminal):
  409. 256 colors; same palette as xterm
  410. *csapprox-iterm.app*
  411. iTerm (iTerm.app):
  412. 256 colors; same palette as xterm
  413. *csapprox-konsole*
  414. Konsole (konsole):
  415. 256 color palette
  416. Colors composed of: [ 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF ]
  417. Same greyscales as xterm
  418. You should set the g:CSApprox_konsole variable unless $TERM begins with
  419. 'konsole', case insensitive
  420. *csapprox-eterm*
  421. eterm (Eterm):
  422. 256 color palette
  423. Colors composed of: [ 0x00, 0x2A, 0x55, 0x7F, 0xAA, 0xD4 ]
  424. Same greyscales as xterm
  425. You should set the g:CSApprox_eterm variable unless $TERM begins with
  426. 'eterm', case insensitive
  427. *csapprox-screen*
  428. GNU Screen (screen):
  429. 256 color support. Internally, uses the xterm palette, but this is only
  430. relevant when running screen inside a terminal with fewer than 256 colors,
  431. in which case screen will attempt to map between its own 256 color cube
  432. and the colors supported by the real terminal to the best of its ability,
  433. in much the same way as CSApprox maps between GUI and terminal colors.
  434. *csapprox-terminals-bad*
  435. -------------------------------- Bad Terminals -------------------------------
  436. This is a list of terminals known _not_ to have high color support. If any of
  437. these terminals have high color support added at some point in the future,
  438. please tell me and I'll update this information.
  439. *csapprox-terminal.app*
  440. Terminal.app (as of OS X 10.5.2)
  441. *csapprox-aterm*
  442. aterm (as of version 1.00.01)
  443. *csapprox-xiterm*
  444. xiterm (as of version 0.5)
  445. *csapprox-wterm*
  446. wterm (as of version 6.2.9)
  447. *csapprox-mlterm*
  448. mlterm (as of version 2.9.4)
  449. *csapprox-kterm*
  450. kterm (as of version 6.2.0)
  451. ==============================================================================
  452. 7. Changelog *csapprox-changelog*
  453. 3.50 01 Apr 2009 Fix a major regression that prevented the Eterm and
  454. Konsole colors from being correctly snapshotted
  455. Fix a related bug causing incorrect terminal colors
  456. after calling :CSApproxSnapshot
  457. Fix a bug causing black to be used instead of dark grey
  458. Have snapshots calculate g:colors_name programmatically
  459. Introduce many tweaks for better speed
  460. Clarify some things at :help csapprox-terminal-example
  461. Default to using our own list of rgb.txt colors rather
  462. than searching, for performance. Add a new variable,
  463. g:CSApprox_use_showrgb, which forces us to try finding
  464. the colors using the "showrgb" program instead, and fall
  465. back on our own list if it isn't available
  466. Remove g:CSApprox_extra_rgb_txt_dirs - not needed in
  467. light of the above change
  468. 3.05 31 Jan 2009 Fix a harmless "Undefined variable" error in
  469. :CSApproxSnapshot
  470. Fix a behavioral bug when dumping out colors defined
  471. external to the scheme.
  472. 3.00 21 Jan 2009 Update the docs for better info on :CSApproxSnapshot
  473. Allow snapshotted schemes to work on Vim 6, and work
  474. properly in Konsole and Eterm (thanks David Majnemer!)
  475. Fix a bug causing a syntax error when using GVim while
  476. CSApprox was loaded. (thanks again, David Majnemer!)
  477. 2.00 14 Dec 2008 Add a hooks system, allowing users to specify a command
  478. to run, either before or after the approximation
  479. algorithm is run, for all schemes or one specific one.
  480. Also rewrite :CSApproxSnapshot to be more maintainable
  481. and less of a hack, and fix several bugs that it
  482. contained.
  483. 1.50 19 Nov 2008 Add CSApproxSnapshot command, as an alternative solution
  484. when the user has gvim or a vim with gui support, but
  485. sometimes needs to use a vim without gui support.
  486. 1.10 28 Oct 2008 Enable running on systems with no rgb.txt (Penn Su)
  487. Begin distributing a copy of rgb.txt with CSApprox
  488. 1.00 04 Oct 2008 First public release
  489. 0.90 14 Sep 2008 Initial beta release
  490. ==============================================================================
  491. 8. Contact Info *csapprox-author*
  492. Your author, a Vim nerd with some free time, was sick of seeing terminals
  493. always get the short end of the stick. He'd like to be notified of any
  494. problems you find - after all, he took the time to write all this lovely
  495. documentation, and this plugin, which took more time than you could possibly
  496. imagine to get working transparently for every colorscheme he could get his
  497. hands on. You can contact him with any problems or praises at mjw@drexel.edu
  498. ==============================================================================
  499. vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl: