# HG changeset patch # User Steve Losh # Date 1305041288 14400 # Node ID 888172aa4c575e68f471352f207fb8838fdbdc77 # Parent c925b9fad53c4424ce743deeabba95d6a47bd000 vim: more django stuff diff -r c925b9fad53c -r 888172aa4c57 vim/.vimrc --- a/vim/.vimrc Tue May 10 11:27:43 2011 -0400 +++ b/vim/.vimrc Tue May 10 11:28:08 2011 -0400 @@ -750,6 +750,27 @@ nmap :QFixToggle " }}} +" Persistent echo ------------------------------------------------------------- {{{ + +" http://vim.wikia.com/wiki/Make_echo_seen_when_it_would_otherwise_disappear_and_go_unseen +" +" further improvement in restoration of the &updatetime. To make this +" usable in the plugins, we want it to be safe for the case when +" two plugins use same this same technique. Two independent +" restorations of &ut can run in unpredictable sequence. In order to +" make it safe, we add additional check in &ut restoration. +let s:Pecho='' +fu! s:Pecho(msg) + let s:hold_ut=&ut | if &ut>1|let &ut=1|en + let s:Pecho=a:msg + aug Pecho + au CursorHold * if s:Pecho!=''|echo s:Pecho + \|let s:Pecho=''|if s:hold_ut > &ut |let &ut=s:hold_ut|en|en + \|aug Pecho|exe 'au!'|aug END|aug! Pecho + aug END +endf + +" }}} " Open quoted ----------------------------------------------------------------- {{{ nnoremap ΓΈ :OpenQuoted diff -r c925b9fad53c -r 888172aa4c57 vim/bundle/django-custom/ftplugin/htmldjango/surround.vim --- a/vim/bundle/django-custom/ftplugin/htmldjango/surround.vim Tue May 10 11:27:43 2011 -0400 +++ b/vim/bundle/django-custom/ftplugin/htmldjango/surround.vim Tue May 10 11:28:08 2011 -0400 @@ -3,4 +3,3 @@ let g:surround_{char2nr("w")} = "{% with\1 \r..*\r &\1 %}\r{% endwith %}" let g:surround_{char2nr("c")} = "{% comment\1 \r..*\r &\1 %}\r{% endcomment %}" let g:surround_{char2nr("f")} = "{% for\1 \r..*\r &\1 %}\r{% endfor %}" - diff -r c925b9fad53c -r 888172aa4c57 vim/snippets/django.snippets --- a/vim/snippets/django.snippets Tue May 10 11:27:43 2011 -0400 +++ b/vim/snippets/django.snippets Tue May 10 11:28:08 2011 -0400 @@ -31,6 +31,8 @@ snippet float ${1:FIELDNAME} = models.FloatField() snippet image + ${1:FIELDNAME} = FileBrowseField(format='Image', max_length=200) +snippet djangoimage ${1:FIELDNAME} = models.ImageField(upload_to=${2:path/for/upload}${3:, height_field=height, width_field=width}${4:, max_length=100}) snippet int ${1:FIELDNAME} = models.IntegerField() @@ -56,7 +58,7 @@ ${1:FIELDNAME} = models.XMLField(schema_path=${2:None}${3:, blank=True}) # Relational Fields snippet fk - ${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, to_field=''}) + ${1:FIELDNAME} = models.ForeignKey(${2:OtherModel}) snippet m2m ${1:FIELDNAME} = models.ManyToManyField(${2:OtherModel}${3:, related_name=''}${4:, limit_choices_to=}${5:, symmetrical=False}${6:, through=''}${7:, db_table=''}) snippet o2o