3

I'm trying to build out LaTeX templates for my engineering coursework, and I love the vim environment for editing, so I've been using vim-latex to integrate the two. I don't quite understand how the templates are being interpreted by vim-latex &/or vim, and google searching has yielded very little.

In particular:
What is the difference between <+ +> and <++>?
What do !comp! and !exe! do achieve?
What languages can I use to do these kind of fill-in-the-blanks processes?

I'm a casual user of vim, so if there's a power-user level concept involved, please point me to where I can read the documentation.

Here's an example of the article.tex template:

1 <+ +> !comp!   !exe!
2 %        File: !comp!expand("%:p:t")!comp!
3 %     Created: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
4 % Last Change: !comp!strftime("%a %b %d %I:00 %p %Y ").substitute(strftime('%Z'), '\<\(\w\)\(\w*\)\>\(\W\|$\)', '\1', 'g')!comp!
5 %
6 \documentclass[a4paper]{article}
7 \begin{document}
8 <++>
9 \end{document}
  • 1
    I'd suggest to use a generic template solution like ultisnips which was designed to provide templates for any language. It includes lots of templates for all sorts of languages (including latex) and it's very easy to extend and create new snippets. – Marco Sep 5 '13 at 8:36
  • I'd second @Marco's suggestion. Have a look at vim snippets for an overview of vim general purpose snippet engines. – Psirus Sep 6 '13 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.