UsingVimWithDjango: python.vim

File python.vim, 572 bytes (added by Lllama, 10 years ago)

Sample ftplugin file containing SnippetsEmu abbreviations for Django models

Line 
1if getline(1) =~ 'from django.core import meta'
2Iabbr addmodel class <>(meta.Model):<CR><><CR><CR>def __repr__(self):<CR>return "%s" % (<>)<CR><CR>class META:<CR>admin = meta.Admin()
3Iabbr mcf meta.CharField(maxlength=<>)<CR><>
4Iabbr mif meta.ImageField(upload_to='<>')<CR><>
5Iabbr mff meta.FileField(upload_to='<>')<CR><>
6Iabbr mint meta.IntegerField()<CR><>
7Iabbr mtf meta.TextField()<CR><>
8Iabbr m2m meta.ManyToManyField(<>, verbose_name='<>')<CR><>
9Iabbr mfk meta.ForeignKey(<>, verbose_name='<>')<CR><>
10Iabbr o2o meta.OneToOneField(<>, verbose_name='<>')<CR><>
11endif
Back to Top