Home AWeather Grits wmpus tools

vpaste is a pastebin that uses Vim for syntax highlighting.

The pastebin

Source Code

Source code is available in git and gitweb

git clone git://pileus.org/vpaste

Embedding examples

vpaste allows pastes to be embedded in external websites:

This can be done by including code in the script tag itself, as in the above example, or by linking to an existing paste:

A third way to use the embedding script is to include it once, possibly in the in the header, and then call the format_code('pre','vpaste') function later on to perform syntax highlighting on all the <pre class="vpaste"> tags.

In this case, slightly more care must be taken to properly escape HTML characters such as < and >.

    #include <stdio.h>

    int main(int argc, char **argv)
        printf("hello, world");
        return 0;