Tuesday, August 7, 2007

 

Syntax highlighting in colour in HTML

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)
{

Comments: Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]