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:


< ?php $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:

    < 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.

Join 164 other subscribers

Archives

  • 2024 (4)
  • 2023 (8)
  • 2022 (15)
  • 2021 (19)
  • 2020 (1)
  • 2019 (1)
  • 2018 (2)
  • 2017 (1)
  • 2016 (2)
  • 2015 (5)
  • 2014 (5)
  • 2013 (2)
  • 2011 (7)
  • 2010 (10)
  • 2009 (50)
  • 2008 (28)
  • 2007 (31)
  • 2006 (8)

Category