48fb846e8cb6

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 26 Jan 2011 12:39:16 -0500
parents a0450320e4bc (current diff) 61a99f136627 (diff)
children e87c94c0f6dd
branches/tags (none)
files vim/.vimrc

Changes

--- a/vim/.vimrc	Wed Jan 26 11:36:01 2011 -0500
+++ b/vim/.vimrc	Wed Jan 26 12:39:16 2011 -0500
@@ -292,7 +292,7 @@
 noremap <leader>roi :RopeOrganizeImports<CR>
 
 " Gundo
-nnoremap U :GundoToggle<CR>
+nnoremap <F5> :GundoToggle<CR>
 let g:gundo_debug = 1
 let g:gundo_preview_bottom = 1
 
--- a/vim/bundle/django-custom/indent/htmldjango.vim	Wed Jan 26 11:36:01 2011 -0500
+++ b/vim/bundle/django-custom/indent/htmldjango.vim	Wed Jan 26 12:39:16 2011 -0500
@@ -45,24 +45,32 @@
     exe "let ind = ".b:html_indentexpr
 
     let lnum = prevnonblank(v:lnum-1)
-    let prev_non_blank_line = getline(lnum)
-    let current_line = getline(v:lnum)
+    let pnb = getline(lnum)
+    let cur = getline(v:lnum)
 
-    let tagstart = '^\s*' . '{%\s*'
-    let tagend = '.*%}' . '\s*$'
+    let tagstart = '.*' . '{%\s*'
+    let tagend = '.*%}' . '.*'
 
     let blocktags = '\(block\|for\|if\|with\|autoescape\|comment\|filter\|spaceless\)'
     let midtags = '\(empty\|else\)'
 
-    if prev_non_blank_line =~# tagstart . blocktags . tagend
+    let pnb_blockstart = pnb =~# tagstart . blocktags . tagend
+    let pnb_blockend   = pnb =~# tagstart . 'end' . blocktags . tagend
+    let pnb_blockmid   = pnb =~# tagstart . midtags . tagend
+
+    let cur_blockstart = cur =~# tagstart . blocktags . tagend
+    let cur_blockend   = cur =~# tagstart . 'end' . blocktags . tagend
+    let cur_blockmid   = cur =~# tagstart . midtags . tagend
+
+    if pnb_blockstart && !pnb_blockend
         let ind = ind + &sw
-    elseif prev_non_blank_line =~# tagstart . midtags . tagend
+    elseif pnb_blockmid && !pnb_blockend
         let ind = ind + &sw
     endif
 
-    if current_line =~# tagstart . 'end' . blocktags . '.*$'
+    if cur_blockend && !cur_blockstart
         let ind = ind - &sw
-    elseif current_line =~# tagstart . midtags . tagend
+    elseif cur_blockmid
         let ind = ind - &sw
     endif