Quick Tip #2 – Adjust default wp-syntax tab size

The WP-Syntax plug-in is great. Exactly what I’m looking for so that I can embed code snippets in my blog. Thank you Ryan. But one thing that struck me was that the tab size was too big. It’s set at 8 spaces by default. No bueƱo. I like my tabs to be 4 characters.

So find the geshi.php file in wp-content/plugins/wp-syntax/geshi/ and open it in your favorite editor.

geshilocation

Find the following line (#503 as of this writing):

503
var $tab_width = 8;

And change the 8 to whatever you like. Done. Lovely. Have a Coke.

UPDATED Sunday, March 1, 2009 Eh… so that doesn’t actually work. I tried another fix I found here, but that ended up changing the font size in the code. So I’m just going to use TextMate to convert all of the tabs to spaces in my code samples.

This entry was posted in WordPress. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

  • Categories