The guys who use scribes will be amazed by its template function. Now here comes a plugin for vim to make vim has the same function.
After download the plugin, please put it under ~/.vim/after/ftplugin, then open it with vim and use command :so % to install it. After the installation, your will see a lot of vim files under the same directory.
A lot of pre-defined templates have been provided with snippetsEmu, even for django template and model. To load django templates, you have to use gvim. There is a snippets menu on gvim and you can load the templates through the menu. Thanks for Felix's reply, who is the author of snippetsEmu.
Now, let us have a try. Open a django model file with vim, input "mmodel" and then press "TAB", you will see  "mmodel" is expanded to
class (models.Model):
  
"""<{}>"""
  
<{}> = <{}>

  
class Admin:
    
pass

    
def __str__(self):
      
return "<{s}>" % <{s}>
    
<{}>
<{}> is the default placeholder. By pressing the "TAB", you are able to jump from one placeholder to the next.
You can also define your own snippets or edit the original snippets by editing the pre-defined snippets files, please  refer to  its  document. BTW, it works well with super-tab plugin.

Please click here to download it.  

Blogged with Flock

Tags: