vimcolor plugin for wordpress

I recently downloaded the vimcolor plugin for wordpress so my code samples could look nice and spiffy, with the syntax highlighting I am accustomed to seeing.

There were of course a few problems. The most notable was some path problems. It was trying to use these values:

$in_file = tempnam($GLOBALS['conf']['file_directory_temp'], 'pl');
$out_file = tempnam($GLOBALS['conf']['file_directory_temp'], 'htm');

I never saw any of these set in any of the configuration files for wordpress, so I just hardcoded in some values that I wanted

There were two other things that I fixed

  1. In order to highlight code, one merely has to put the code in a code block, and set the style, something like this:
    &lt; code type="php"&gt;some code here&lt; /code &gt;;

    The problem was that the plugin was specifically looking for type=”[a-z]+”, with the quotation marks as part of the regular expression. I like to use single quotes (don’t have to press the shift key), and this is legal html. So I changed that to allow both single and double quotes, using type=(\’|”)[a-z]+(\’|”)

  2. The other thing I changed was actually just css. The author, whom I tried to track down, but could not, mentioned that he would like a horizonatal scroll bar to appear automatically. This is simply down with the CSS rule overflow:auto;

I hope you enjoy the syntax highlighting as much as I do.

This entry was posted in (x)html, css, wiki/cms. Bookmark the permalink.

One Response to vimcolor plugin for wordpress

  1. I have been a frequent visitor of this blog for some time now, so I thought it would be a good idea to leave you with my thanks.

    Jim Mirkalami