hexhighlight


Ⅰ. 插件描述

vim+gvim plugin to highlight hex-color-codes in the corresponding color

Ⅱ. 基本信息

创建日期:  2010-01-30
使用用户:  3
Github星:  2
插件作者:  Thomas G.

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# vim-hexhighlight

Description

This plugin provides two functionalities:

  1. <Plug>ToggleHexHighlight colorizes the background of hexcodes in the format #aabbcc or #abc in the corresponding color.
  2. <Plug>ToggleSchemeHighlight applies the formatting defined by all :highlight commands to the corresponding line.

Both commands operate on the currently opened file.

Requirements

This version works with graphical versions of vim as well as terminal versions of vim!
In the non-gui case, a 256 color terminal is required and the hexcode is approximated using a couple of scripts from Vim-toCterm.

Installation

You can install this plugin using vim-pathogen:

cd ~/.vim/bundle
git clone <URL>

Alternatively, you can simply extract everything into your ~/.vim directory.

If your vim does not correctly detect that it is indeed running from a 256 color terminal, you can force vim to work honor this by setting

set t_Co=256

in your ~/.vimrc.

Interface

There is no keybinding exposed by default. I suggest to add keybindings in
your .vimrc:

nmap <F2>           <Plug>ToggleHexHighlight
nmap <leader><F2>   <Plug>ToggleSchemeHighlight

添加新评论