# HG changeset patch # User Steve Losh # Date 1308320357 14400 # Node ID e93c240fe42c32ed916ddc6d1f1097f39a53a850 # Parent 28dc966cf3f0f506c245d653ac717d27e0111545 Moar. diff -r 28dc966cf3f0 -r e93c240fe42c .hgsubstate --- a/.hgsubstate Fri Jun 17 10:18:58 2011 -0400 +++ b/.hgsubstate Fri Jun 17 10:19:17 2011 -0400 @@ -17,4 +17,4 @@ 4995b244e11d5aaa9956bba061c32140e6af8705 vim/bundle/threesome b9b4407a19acc4eb344cca0cc5beea75e9ff5491 vim/bundle/vim-coffee-script c2df2e430d7d5fe645aa40e36079ab51f082e06b vim/bundle/vim-javascript -3d1692f635579e718b85dd8f24ac7fbd52a444f6 vim/bundle/vim-orgmode +24c00fcb00145bd283fc6d2b4494ab02a46941f6 vim/bundle/vim-orgmode diff -r 28dc966cf3f0 -r e93c240fe42c hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hgignore Fri Jun 17 10:19:17 2011 -0400 @@ -0,0 +1,5 @@ +syntax: glob + +.DS_Store +*.pyc +tags diff -r 28dc966cf3f0 -r e93c240fe42c vim/.vimrc --- a/vim/.vimrc Fri Jun 17 10:18:58 2011 -0400 +++ b/vim/.vimrc Fri Jun 17 10:19:17 2011 -0400 @@ -641,10 +641,12 @@ if len( swanks ) == 0 " Try to find SWANK in the standard SLIME installation locations - if g:slimv_windows || g:slimv_cygwin - let swanks = split( globpath( 'c:/slime/,c:/*lisp*/slime/,c:/*lisp*/site/lisp/slime/,c:/Program Files/*lisp*/site/lisp/slime/', 'start-swank.lisp' ), '\n' ) - else - let swanks = split( globpath( '/usr/share/common-lisp/source/slime/', 'start-swank.lisp' ), '\n' ) + if exists('g:slimv_windows') + if g:slimv_windows || g:slimv_cygwin + let swanks = split( globpath( 'c:/slime/,c:/*lisp*/slime/,c:/*lisp*/site/lisp/slime/,c:/Program Files/*lisp*/site/lisp/slime/', 'start-swank.lisp' ), '\n' ) + else + let swanks = split( globpath( '/usr/share/common-lisp/source/slime/', 'start-swank.lisp' ), '\n' ) + endif endif endif diff -r 28dc966cf3f0 -r e93c240fe42c vim/ftplugin/python/folding.vim --- a/vim/ftplugin/python/folding.vim Fri Jun 17 10:18:58 2011 -0400 +++ b/vim/ftplugin/python/folding.vim Fri Jun 17 10:19:17 2011 -0400 @@ -47,6 +47,8 @@ setlocal foldmethod=expr setlocal foldexpr=GetPythonFold(v:lnum) setlocal foldtext=PythonFoldText() +nnoremap D :setlocal foldtext=PythonFoldTextDocstrings() +nnoremap d :setlocal foldtext=PythonFoldText() function! PythonFoldText() " ignore decorators @@ -68,6 +70,33 @@ return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' ' endfunction +function! PythonFoldTextDocstrings() + " ignore decorators + let fs = v:foldstart + while getline(fs) =~ '^\s*@' | let fs = nextnonblank(fs + 1) + endwhile + + " add docstrings + let line = getline(fs) + if getline(fs + 1) =~ '^\s*"""' + let line = line . " (" . getline(fs + 1) . ")" + let line = substitute(line, '\s*"""', '', 'g') + let line = substitute(line, '"""', '', 'g') + endif + + 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) + return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' ' +endfunction + function! GetBlockIndent(lnum) " Auxiliary function; determines the indent level of the surrounding def/class " "global" lines are level 0, first def &shiftwidth, and so on