As you can maybe see from my previous post, I’ve got my syntax highlighted. There is no plugin working its magic behind it, infact, since I’m not hosting this blog myself, I can’t use plugins at all. Nevertheless, one solution for highlighting syntax is to ‘wrap’ it with html, which works with the wordpress posts. I found out that with gVim you can Syntax->Convert to HTML. With gVim you need to use the “:TOhtml” user command. All you need to do is copy the output into you post. You might want to make the font size something like 3 by adding size=”3″ into <font face=”monospace”> which is in the beginning of the output - <font face=”monospace” size=”3″>. If you know some other/better way to do this please comment. Hope this helps ![]()
Syntax Highlight Without Plugins
Published January 29, 2008 howto , syntaxTags: blog, code, color, convert, embed, font, highlight, highlighted, howto, html, output, plugin, program, script, solution, syntax, vim, wordpress, wrap
very nice. I’m guessing when stating Vim that means Gvim? I am unaware of a method that can do this in regular vim.
Yeah it’s gVim, I’ll edit the post. Thanks for commenting
Hi, nice post. I republished this article in Indonesian. I add a tag to limit the width of source code n tag to ignore the long line source code. I also use style=”overflow:auto; width:100%” to arrange the source code apperance. I use gVIm too, but Notepad++ is also possible. You can see my article in http://www.iroel.web.id/portable-windows-dns-server-for-windows.htm, if you don’t like, I can remove it
iroel
Y!M rilvo
Cool
“style=”overflow:auto; width:100%” to arrange the source code apperance.”
- that’s good to include.