Maggie Nelson

Finally, pretty syntax highlighting for blog posts!

by maggie on Feb.26, 2009, under entry

A coworker, Craig Campbell just launched a new blog recently. One of the really neat things about his blog is how he handles syntax highlighting for code samples – check out examples in his interesting post about Cool Object Building with PHP. In fact, he got so many good comments about this approach that he even wrote a post explaining exactly how he does it: Syntax Highlighting for Your Blog Using TextMate. (It even works in Internet Exploder!)

I’ve been looking for a good solution for syntax highlighting for code samples I post on this blog since my move to WordPress, so his solution certainly looks appealing. I use vim as my main editor and I’ve been staying away from TextMate for quite some time. However, there seems to be a lot of interest in creating vi plugins for TextMate that would emulate vi behavior, such as TextMate vi Plugin. If you’ve ever used and loved vi/vim, you know that it’s hard to move to an editor that requires the use of a mouse for text editing. I finally caved in 2 years ago and moved from Linux to Mac as my primary development environment, so perhaps checking out TextMate is a good idea.

I’m still keeping pine/alpine for reading e-mail though!

:, , , , ,
5 comments for this entry:
  1. Anon

    Mac? Should have switched to Windows XP Pro.

    Fail.

  2. Davey Shafik

    I use SyntaxHighlighter Plus, it works pretty well for me except it double encodes the < in <?php so I just left them out.

    http://thislab.com/2007/12/16/release-wordpress-plugin-syntaxhighlighter-plus/

  3. Andy

    Looks like the geishi syntax highlighter became pretty much the standard for many blog applications too.

  4. Johanna Cherry

    Hey Maggie,
    TextMate is designed from the ground up to be used without a mouse, using key commands for everything. However, the GUI is available for those who want to use a mouse. So you won’t have to change to mousing all the time.

    I would suggest staying away from the vi plugin though. I’ve not tried it, so perhaps its great, but I think the bundles of commands and snippets in addition to its core functionality fill in all the holes developers run into. Plus you can do real neat stuff like open files in TextMate from Terminal!

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Tags

RSS Planet PHP

  • Module Bootstraps in Zend Framework: Do's and Don'ts
    I see a number of questions regularly about module bootstraps in Zend Framework, and decided it was time to write a post about them finally. In Zend Framework 1.8.0, we added Zend_Application, which is intended to (a) formalize the bootstrapping process, and (b) make it re-usable. One aspect of it was to allow bootstrapping of individ […]
    Matthew Weier O'Phinney
  • Webinar - New in Zend Framework 1.10!
    Zend Framework 1.10 sports a ton of new features, as well as completely revamped online documentation. In this webinar, Matthew Weier O’Phinney, Framework Project Lead, and Ralph Schindler, Zend Framework Software Engineer, will present a synopsis of the new features, discuss the new online documentation system and how it’s built, and answer your questions a […]
    Zend Developer Zone
  • ConFoo PHP 5.3 == Awesome! Slides
    Finally managed to upload my slides from my ConFoo PHP 5.3 == Awesome! talk. Slides Thanks for all the attendees, especially those who asked questions […]
    Ilia Alshanetsky
  • ConFoo PHP 5.3 == Awesome! Slides
    Finally managed to upload my slides from my ConFoo PHP 5.3 == Awesome! talk. Slides Thanks for all the attendees, especially those who asked questions […]
    Ilia Alshanetsky
  • Slides from my Confoo.ca talk now online
    I’ve just uploaded the slides from my confoo.ca talk “Making software management tools work for you”. You can download the slides from here. Thanks again to everyone who attended! Please give me feedback on joind.in. […]
    John Mertic