sponsor Vim development Vim logo Vim Book Ad

SuperPre : syntax for the text that contains several programming language

 script karma  Rating 1/3, Downloaded by 1184  Comments, bugs, improvements  Vim wiki

created by
Yukihiro Nakadaira
script type
The spre (SuperPre) is a syntax plugin for the text that contains several programing language.  The text can be converted to HTML.  This is useful for writing programming notes or creating web pages.

spre syntax is like a C macro.  Example to make HTML:
" You can use Vim script as embedded macro.
return "<h1>Example to make HTML</h1>"

## comment is removed from result.

#pre c {"colorscheme":"evening"}
/* This section will be <pre class="c">...</pre> */
int func(int n) {
  return func(n);

let s:attr = {}
let s:attr.colorscheme = "desert"
let s:attr.tag = "div"
let s:attr.class = "c main"
let s:attr.modeline = "list number"
#pre c s:attr
/* This section will be <div class="c main">...</div> */
int main(int argc, char **argv) {
  return 0;

return readfile(expand("%:p:h") . "/footer.txt")

If you want to highlight HTML tag outside of spre macro:
  :set ft=html.spre
Spre will work as additional syntax.

colored example:
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
spre.zip 1.3 2007-10-26 7.0 Yukihiro Nakadaira Added #macro
spre.zip 1.2 2007-07-06 7.0 Yukihiro Nakadaira bug fix
spre.zip 1.1 2007-06-04 7.0 Yukihiro Nakadaira bug fix
spre.zip 1.0 2007-06-02 7.0 Yukihiro Nakadaira Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
OSDN.net Logo