7ee2661d5bd8

Merge.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 10 Jun 2010 17:53:17 -0400
parents 309b770e8a8d (current diff) 181d0ea03b77 (diff)
children 1a3ee92103ed
branches/tags (none)
files

Changes

--- a/vim/.vimrc	Wed Jun 09 17:53:48 2010 -0400
+++ b/vim/.vimrc	Thu Jun 10 17:53:17 2010 -0400
@@ -91,6 +91,25 @@
 set foldlevelstart=1
 nnoremap <F1> za
 vnoremap <F1> za
+au BufNewFile,BufRead *.html map <leader>ft Vatzf
+
+set foldtext=MyFoldText()
+function! MyFoldText()
+    let line = getline(v:foldstart)
+
+    let nucolwidth = &fdc + &number * &numberwidth
+    let windowwidth = winwidth(0) - nucolwidth - 3
+    let foldedlinecount = v:foldend - v:foldstart
+
+    " expand tabs into spaces
+    let onetab = strpart('          ', 0, &tabstop)
+    let line = substitute(line, '\t', onetab, 'g')
+
+    let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount))
+    let fillcharcount = windowwidth - len(line) - len(foldedlinecount) - 1
+    return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' '
+endfunction
+
 
 " Fuck you, help key.
 imap <F1> <nop>