sponsor Vim development Vim logo Vim Book Ad

typeredeemer : Simple font-size unit conversion for your CSS stylesheets

 script karma  Rating 5/2, Downloaded by 463  Comments, bugs, improvements  Vim wiki

created by
Lou Gonzalez
 
script type
utility
 
description
Ever wanted to change your font-size/line-height declarations from one unit to another without resorting to going back and forth between vim and an online conversion tool? This script lets you convert between px, em and % values through the use of some simple key mappings.

Mappings for converting one font-size/line-height declaration at a time include:

<leader>px - convert value to px equivalent
<leader>em - convert value to em equivalent
<leader>p% - convert value to percent equivalent

To convert all font-size and line-height declarations at the same time:

<leader>apx - convert all to px
<leader>aem - convert all to em
<leader>ap% - convert all to %

You don't have to be bound to the browser default size of 16px, which this script uses by default. To change this value, use the mapping '<leader>sd' and specify a new default size in px (i.e. 17.0). To check what this value is at any time, use the mapping '<leader>gd'.
 
install details
Unzip in your ~/.vim folder and run :helptags ~/.vim/doc.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
typeredeemer.zip 0.1.0 2010-07-31 7.0 Lou Gonzalez Initial upload
ip used for rating: 3.138.141.202

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github