colornames


Ⅰ. 插件描述

Show named colors / cterm colors with hex code and name colorized in a window

Ⅱ. 基本信息

创建日期:  2006-07-10
使用用户:  1
Github星:  2
插件作者:  Walter Hutchins

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/colornames'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/colornames'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/colornames'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/colornames

Ⅳ. 文档说明

Show named colors / cterm colors with hex code, name, colorized in a window

Named colors work in gui only - no color in xterm

cterm/gui colors work in gui and 256 xterms

call Showhexcolornames() - show all, do not clear syntax

call Showhexcolornames(b) - show all (background), do not clear syntax

call Showhexcolornames(9) - show all after clearing syntax

call Showcolornames(n) - show nth 182 named colors or nth cterm colors
                                             do not clear syntax.
                    [n: 1-3, named]
                    [n: 4-5, cterm]
                    [n: 10,11, cterm (hsv sorted)]
                    [n: 12-14 named (hsv sorted)]
                    [n: 20-24 mixed (hsv sorted)]
                    [hsv sorted: black->red->green->blue->purple]

call Showcolornames(9,n) - show nth 182 named colors or nth cterm colors
                                                after clearing syntax.
                    [n: 1-3, named]
                    [n: 4-5, cterm]
                    [n: 10,11, cterm (hsv sorted)]
                    [n: 12-14 named (hsv sorted)]
                    [n: 20-24 mixed (hsv sorted)]
                    [hsv sorted: black->red->green->blue->purple]

    n, b, 9 may be combined as in
                            Showhexcolors(9,4,5) - clear/ show all cterm
                            Showhexcolors(9,1,2,3) - clear/ show all named
                            Showhexcolors(9,r,4) - clear/ show 1st cterm
                                                                    group in background blocks

    n=0 - all named colors
    n=6 - all cterm colors
    n=7 - all mixed colors (hsv sorted)
    n=15 - all named colors (hsv sorted)
    n=16 - all cterm colors (hsv sorted)

    n=20 - mixed, hsv sorted, "blacks to whites
    n=21 - mixed, hsv sorted, "reds to yellows
    n=22 - mixed, hsv sorted, "yellows to greens
    n=23 - mixed, hsv sorted, "blues
    n=24 - mixed, hsv sorted, "purples

    r   - same as b (or background, or reverse)

call Showhexcolornames(8) - cleanup highlighting added by Showhexcolornames

vim < 7 only can show 223 simultaneous highlight groups.
        Once that limit is exceeded, the colors will be random until exit.
        Therefore use 1, 2, 3, 4, or 5 (group of) colors in call.
        Also use 9 - clear syntax, since it needs to clear syntax
        to avoid the 223 limit which makes random colors.

vim 7 does not have max 223 colors problem

This script is also used by color_toon.vim for selecting colorscheme colors.

添加新评论