Saturday, March 24, 2007

Syntax highlighting in colour in HTML  [Digg.com This!]

I recently found a fantastic feature in GVIM that allows me to syntax highlight my code and turns it into HTML. I'm sure there are tools out there specifically for this job, but given the convenience of having this built into my editor I couldn't help but mention it.

You can get GVIM from their website. When you've loaded your code up (and practically every language is supported), click the Syntax -> Convert to HTML menu option.

Here's a sample:


<?php

if (isset($_GET['album']))
{
//echo 'gallery: ' . $_GET['album'];
$d = dir('Photos/' . $_GET['album']);

$bFirst = true;
while ( ($file = $d->read()) !== false)
{
if (strpos($file, 'tb.jpg') !== false)
{

Thursday, March 01, 2007

FIX: Microsoft Word 2003 Backspace Doesn't Work  [Digg.com This!]

I just came across some really annoying behaviour with Word 2003 (I dare say it's the same with 2000 and XP too). I somehow managed to change the behaviour so when I selected some text and pressed backspace the text remained there and the cursor moved to the start of the selection. Equally if I selected a word and tried typing over it the original word remained there and the new word would be typed immediately before it.

Solution: Turn on 'Typing replaces selection' mode.

Options -> Edit tab -> Tick 'Typing replaces selection'