[Tutor] OT: Vim was: free IDE for Python?

Senthil_OR at Dell.com Senthil_OR at Dell.com
Fri Nov 17 21:04:06 CET 2006


William O'Higgins Witteman wrote:
> On Fri, Nov 17, 2006 at 11:02:18AM +0530, Senthil_OR at Dell.com wrote:
> 
>> What the settings of ppl using vim for python?
> 
> A few Python-specific things that I have in my .vimrc are as follows:

Thanks for sharing William. 
I think ppl in this list , might also be interested in this _vimrc ( I
am on windows) snippet, which on pressing Alt+D over a module name will
take us to its documentation.

function! OnlineDoc() 
    if &ft =~ "python" 
        let s:urlTemplate = "http://docs.python.org/lib/module-%.html"
    else 
        return 
    endif 
    let s:browser = "\"C:\\Program Files\\Internet
Explorer\\IEXPLORE.EXE\"" 
    let s:wordUnderCursor = expand("<cword>") 
    let s:url = substitute(s:urlTemplate, "%", s:wordUnderCursor, "g") 

    let s:cmd = "silent !start " . s:browser . " " . s:url 
    execute  s:cmd 
endfunction 

" online doc search 
map <silent> <M-d> :call OnlineDoc()<CR> 

- It is written with modifications from vim tips page.

Thanks,
-- 
Senthil


More information about the Tutor mailing list