Giter Club home page Giter Club logo

templator_vim's Introduction

In many programming languages/environments, you usually work with a set of files 
that belong together. E.g. if you create a c file, you usually also want to 
create a h header file. If you create a viewer file, you usually also want to 
create corresponding model and controller files. If you want to create a 
library file, you usually also want to create some test file etc. This is were 
templator comes in.

The templator plugin allows the creation of filesets based on multi-file 
templates. Possible use cases:

    - Create multi-file projects
    - Create multiple-files within a project, e.g.
        - a source file and the corresponding header file
        - a source file and the corresponding test file
        - files for a model, a view, and a controller

Templates can be written in any code template/skeleton/snippets style. At the 
time of writing, templates can be written in:

    - template vim (see |templator-tvim|) ("tvim" extension)
    - tskeleton (vimscript #1160) ("tskel" extension)

It shouldn't be too difficult to add support for additional template 
engines.

The |:Templator| command can be used to create multi-file projects.

Example 1: Create files for the "vimplugin" template-set in the current root 
directory, which usually is the current working directory unless 
|b:templator_root_dir| is set (see |templator-arguments| for details): >

    :Templator vimplugin myplugin

"myplugin" is the plugin's name. The argument is required by the 
template set used in this example. It is also possible to use named 
arguments.

Example 2: Create files for the "vimplugin" template-set in some directory (the 
directory is created if it doesn't already exist): >

    :Templator ~/src/foo/bar/vimplugin myplugin

Templates are kept in "templator" subdirectories in your 'runtimepath' (e.g. 
~/.vim/templator). A subdirectory's name consists of 
"TEMPLATE_NAME.TEMPLATE_TYPE". TEMPLATE_NAME is the name that is used for the 
|:Templator| command. TEMPLATE_TYPE is the name of the template engine used to 
expand file templates.

Templates consist of a bunch of files and an optional vim script (see 
|templator-scripts|) that is run after creating the files.


-----------------------------------------------------------------------

Status:  Experimental
Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
See http://github.com/tomtom for related plugins.

templator_vim's People

Contributors

tomtom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

templator_vim's Issues

Templator doesn't recognize newly created template dirs/added files

Hi tomtom,

first of all thanks for your effort you put into templator. For me, it seems to be the first plugin that is dedicated to multi-file templates.

Unfortunately if i add some files to a template directory or create a new one the :Templator doesn't recognize these changes. Only after a restart of vim the changes take effect.

It looks like templator have some sort of cache that maps the important content of all templator dirs in &runtimepath. Is there a way to reload this cache at runtime?

Thanks for your effort and with best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.