sponsor Vim development Vim logo Vim Book Ad

HTMLxC.vim : Edit hex color codes in HTML files easily using rgb decimal; Perl req'd.

 script karma  Rating 1/1, Downloaded by 754  Comments, bugs, improvements  Vim wiki

created by
Sören Andersen
 
script type
utility
 
description
I've found that the default installed programs on my platform include several that specify colors as decimal r,g,b but none offer to show the color as the hexadecimal triplet used in HTML. It got to be very annoying to have to use a color browser or other graphics tool, then manually convert a color I liked to hex, before being able to even try out a color in a Web page I was building.

This small plugin utility just identifies the hex color spec under the cursor and pop-up dialogs (on GUI Vim) or prompts on the Vim commandline (on console Vim) for a decimal r g b -style spec (space-separated) and then inserts it as hex in replacement of the existing hex string.
 
install details
Requires that Vim have been compiled with support for Perl (embedded perl interpreter). Someone is likely to come along and say this can be written in Vim w/o Perl. That's fine. I like programming in Perl. I like my Vim to have Perl.

Just place the HTMLxC.vim file in a plugin/ dir in one of your $VIMRUNTIME locations. It then can be loaded with an \"au\" command from an initialization script or explicitly w/ \":runtime!\" or \":source\". It does a key mapping ... <leader>*  (literally asterix) to call the plugin function.
 

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
HTMLxC.vim 1.2 2004-07-19 6.0 Sören Andersen Initial upload
ip used for rating: 3.80.164.96

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