Steve Losh avatar Steve Losh committed e93c240

Moar.

Comments (0)

Files changed (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
+syntax: glob
+
+.DS_Store
+*.pyc
+tags
 
 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
 

vim/ftplugin/python/folding.vim

 setlocal foldmethod=expr
 setlocal foldexpr=GetPythonFold(v:lnum)
 setlocal foldtext=PythonFoldText()
+nnoremap <buffer> <localleader>D :setlocal foldtext=PythonFoldTextDocstrings()<cr>
+nnoremap <buffer> <localleader>d :setlocal foldtext=PythonFoldText()<cr>
 
 function! PythonFoldText()
     " ignore decorators
     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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.