Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moar.

  • Loading branch information...
commit f9b885a35e9a2919c5e2298731907889f9fe8284 1 parent 7a3d2f3
@sjl authored
View
2  .hgsubstate
@@ -17,4 +17,4 @@ c6197a10ace82e0fe0c08e5cf5c017b7069a978e vim/bundle/sparkup
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
View
5 hgignore
@@ -0,0 +1,5 @@
+syntax: glob
+
+.DS_Store
+*.pyc
+tags
View
10 vim/.vimrc
@@ -641,10 +641,12 @@ let swanks = split( globpath( &runtimepath, 'slime/start-swank.lisp'), '\n' )
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
View
29 vim/ftplugin/python/folding.vim
@@ -47,6 +47,8 @@ endif
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
@@ -68,6 +70,33 @@ function! PythonFoldText()
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
Please sign in to comment.
Something went wrong with that request. Please try again.