vim-px-to-em


Ⅰ. 插件描述

Convert pixels to ems or ems to pixels using easy vim commands. Makes font-size unit conversion for your CSS stylesheets easy.

Ⅱ. 基本信息

创建日期:  2015-03-19
使用用户:  2
Github星:  2
插件作者:  Chiedo John

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

Vim-px-to-em - Convert px to em or em to px

Makes font-size unit conversion for your CSS stylesheets easy!

Installation

Pathogen Install

  1. Navigate to your [VIM_ROOT]/bundle directory in your local Vim setup
  2. git clone https://github.com/chiedojohn/vim-px-to-em.git

Usage

To convert the pixels to ems, select a block of text in visual mode and the enter the following :

:Em

Or enter the following to convert the ems to pixels:

:Px

To convert all pixels in the file to ems:

:EmAll

Or to convert all ems in the file to pixels:

:PxAll

Add a bang (eg. :Px!) to any of the above command to bypass the prompts before each conversion.

If you don't want to use the standard Base font of 16px, add the following to your ~/.vimrc

let g:px_to_em_base = DIFFERENT_FONT_SIZE

Example:

let g:px_to_em_base = 24

License

Distributed under the same terms as Vim itself. See :help license.

添加新评论