vimcolor plugin for wordpress

December 27th, 2006

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:

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:
    < code type="php">some code here< /code >;

    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.

  • FriendFeed
  • Reddit
  • del.icio.us
  • Digg
  • Slashdot
  • Technorati
  • Facebook
  • Fark
  • TwitThis
  • LinkedIn

One Response to “vimcolor plugin for wordpress”

  1. On February 6th, 2008 at 7:18 pm
    Jim Mirkalami wrote:

    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.

    Regards,
    Jim Mirkalami

Leave a Reply