Skip to content
drdrxp edited this page Jul 2, 2011 · 5 revisions

XP's Template engine for vim

Code snippets engine for Vim. And snippets library. Life is short, do less, get more. You can use XPtemplate as a Snippet Engine or as a Language Grammar Guide.

Usage

vim xpt.c
for<C-\>

generates:

for (i = 0; i < len; ++i){
    /* cursor */
}

Press <tab>,<tab>.. to navigate through "i", "0", "len" and finally stop at "/* cursor */"

Home: http://www.vim.org/scripts/script.php?script_id=2611

Discuss, Bug report, Feature request : http://groups.google.com/group/xptemplate

Get the Latest from GIT/SVN

Screencast : 0.3.9

C language: http://www.vimeo.com/7614329

Python: http://www.vimeo.com/7868048

Tutorial by Derek Wyatt : http://vimeo.com/4449258

Features for User

Live update as typing

No worrying about breaking snippet rendering incautiously.

Navigate forward and backward. <Tab> and <S-Tab>

Embed language support like JAVASCRIPT in HTML. Or HTML in PHP.

Repetition item, such as the "case" in "switch"

Wrapper snippet

Features for Snippet Writer

Inclusion support on snippet level or file level

Functions and variables can be used to generate dynamical content

Format customization: for example the line break before "{"

Place holders can be very simple, even without a index number or name!

Place holders can have order or not

Alternative item default value other than place holder's name.

Filter for cleaning up issues.

Clone this wiki locally