vim-css-to-inline


Ⅰ. 插件描述

Transforms plain css into JSX inline styles

Ⅱ. 基本信息

创建日期:  2016-08-16
使用用户:  5
Github星:  12
插件作者:  Jane

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'isomoar/vim-css-to-inline'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'isomoar/vim-css-to-inline'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'isomoar/vim-css-to-inline'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/isomoar/vim-css-to-inline

Ⅳ. 文档说明

vim-css-to-inline

Transforms plain css to JSX inline styles and vise versa

Build Status

Installation

With plugin manager like Vim-plug:

Plug 'isomoar/vim-css-to-inline'

Usage

Default mappings:

  • tis - transform to inline styles
  • fis - transform from inline styles to css

In normal mode plugin automatically transforms everything between curly braces
{}.

Customization

Use the g:csstoinline_no_mapping option and the <Plug> maps to customize the maps:

let g:csstoinline_no_mapping = 1
nmap <leader>is <Plug>ToInlineN
xmap <leader>is <Plug>ToInlineV
nmap <leader>cs <Plug>FromInlineN
xmap <leader>cs <Plug>FromInlineV

Options

By default plugin transforms pixels to numbers:

12px -> 12

If you want to wrap pixel values in quotes, add this option to your .vimrc:

let g:csstoinline_wrap_pixels = 1

添加新评论