CSSMinister


Ⅰ. 插件描述

Converts colors in CSS stylesheets from one format to another

Ⅱ. 基本信息

创建日期:  2010-03-07
使用用户:  13
Github星:  6
插件作者:  Lou Gonzalez

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

CSSMinister provides functions and mappings that convert any hexadecimal, keyword, RGB(A) or HSL(A) color values from one format to another.  The functions fall into two categories:  1) those that change the next matching color only, and 2) those that change all colors matching the requested format in a range or in the entire buffer.

Functions that change formats one color at a time include:

  :ToHex
  :ToRGB
  :ToRGBA
  :ToHSL
  :ToHSLA

Functions that change all colors matching the requested color format in a range or in the entire buffer:

  :ToHexAll <format>
  :ToRGBAll <format>
  :ToRGBAAll <format>
  :ToHSLAll <format>
  :ToHSLAAll <format>

Where <format> is the color format you're converting from.

As of v1.0.0, the above commands replace the old key mappings as a less obtrusive solution for converting between different color formats. Some key mappings remain for those that prefer them:

  <leader>x - convert to hex
  <leader>r - convert to rgb
  <leader>h - convert to hsl
  <leader>ra - convert to rgba
  <leader>ha - convert to hsla

This script was tested with CSS, Sass and Less stylesheets.  However, it should work anywhere CSS color values are used.

添加新评论