Skip to content

Commit 9f658ab

Browse files
Matt Wozniskivim-scripts
authored andcommitted
Version 1.00: Initial upload
0 parents  commit 9f658ab

File tree

3 files changed

+1126
-0
lines changed

3 files changed

+1126
-0
lines changed

README

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
This is a mirror of http://www.vim.org/scripts/script.php?script_id=2390
2+
3+
CSApprox.vim
4+
5+
============
6+
DESCRIPTION
7+
============
8+
9+
It's hard to find colorschemes for terminal Vim. Most colorschemes are
10+
written to only support GVim, and don't work at all in terminal Vim.
11+
12+
This plugin makes GVim-only colorschemes Just Work in terminal Vim, as long
13+
as the terminal supports 88 or 256 colors - and most do these days. This
14+
usually requires no user interaction (but see the help for what to do if
15+
things don't Just Work). After getting this plugin happily installed, any
16+
time you use :colorscheme it will do its magic and make the colorscheme Just
17+
Work.
18+
19+
Whenever you change colorschemes using the :colorscheme command this script
20+
will be executed. It will take the colors that the scheme specified for use
21+
in the GUI and use an approximation algorithm to try to gracefully degrade
22+
them to the closest color available in your terminal. If you are running in
23+
a GUI or if your terminal doesn't support 88 or 256 colors, no changes are
24+
made. Also, no changes will be made if the colorscheme seems to have been
25+
high color already.
26+
27+
If for some reason this transparent method isn't suitable to you (for instance
28+
if your environment can't be configured to meet the |csapprox-requirements|,
29+
or you need to work in Vim 6), another option is also available: using the
30+
|:CSApproxSnapshot| command to create a new GUI/88-/256-color terminal
31+
colorscheme. To use this command, a user would generally start GVim, choose a
32+
colorscheme that sets up the desired colors, and then use |:CSApproxSnapshot|
33+
to create a new colorscheme based on those colors that works in high color
34+
terminals. This method is more flexible than the transparent mode and works
35+
in more places, but also requires more user intervention, and makes it harder
36+
to deal with colorschemes being updated and such.
37+
38+
======
39+
NOTES
40+
======
41+
42+
Ideally, this plugin should require absolutely no configuration, but you may
43+
need some tweaking to make sure vim realizes that your terminal supports more
44+
than 16 colors. Also, konsole and Eterm users will want to make sure that
45+
this plugin realizes that the terminal does not use colors that are exactly
46+
xterm-compatible; they will want to skim through the help articles
47+
|csapprox-palettes| and |csapprox-configuration| for a better end result.
48+
49+
==============
50+
SCREENSHOTS
51+
==============
52+
53+
Some quick side-by-side screenshots can be found at
54+
http://www.cs.drexel.edu/~mjw452/CSApprox/

0 commit comments

Comments
 (0)