Adding new stuff
This commit is contained in:
parent
cb028acf05
commit
7b21428a6d
451 changed files with 6 additions and 1 deletions
|
|
@ -1,37 +0,0 @@
|
|||
" Python-mode search by documentation
|
||||
"
|
||||
PymodePython import pymode
|
||||
|
||||
fun! pymode#doc#find() "{{{
|
||||
" Extract the 'word' at the cursor, expanding leftwards across identifiers
|
||||
" and the . operator, and rightwards across the identifier only.
|
||||
"
|
||||
" For example:
|
||||
" import xml.dom.minidom
|
||||
" ^ !
|
||||
"
|
||||
" With the cursor at ^ this returns 'xml'; at ! it returns 'xml.dom'.
|
||||
let l:line = getline(".")
|
||||
let l:pre = l:line[:col(".") - 1]
|
||||
let l:suf = l:line[col("."):]
|
||||
let word = matchstr(pre, "[A-Za-z0-9_.]*$") . matchstr(suf, "^[A-Za-z0-9_]*")
|
||||
call pymode#doc#show(word)
|
||||
endfunction "}}}
|
||||
|
||||
fun! pymode#doc#show(word) "{{{
|
||||
if a:word == ''
|
||||
call pymode#error("No name/symbol under cursor!")
|
||||
return 0
|
||||
endif
|
||||
|
||||
call pymode#tempbuffer_open('__doc__')
|
||||
PymodePython pymode.get_documentation()
|
||||
setlocal nomodifiable
|
||||
setlocal nomodified
|
||||
setlocal filetype=rst
|
||||
if g:pymode_doc_vertical
|
||||
wincmd L
|
||||
endif
|
||||
wincmd p
|
||||
|
||||
endfunction "}}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue