Ⅰ. 插件描述
vim+gvim plugin to highlight hex-color-codes in the corresponding colorⅡ. 基本信息
|
Ⅲ. 安装方法
使用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:
<Plug>ToggleHexHighlightcolorizes the background of hexcodes in the format#aabbccor#abcin the corresponding color.<Plug>ToggleSchemeHighlightapplies the formatting defined by all:highlightcommands 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=256in 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