Code Monkey home page Code Monkey logo

pydoc.vim's Introduction

pydoc.vim integrates Python documentation system into Vim. If you use
Vim and Python, you want to use it :-)

pydoc.vim is an ftplugin and has to be installed in your ftplugin directory.
Installing it in the plugin directory won't work.

Also note that you need a line like the following in your .vimrc file:
  filetype plugin on

You can find the complete documentation in the code itself.

Happy hacking!

pydoc.vim's People

Contributors

blueyed avatar davidventura avatar fs111 avatar jimenezrick avatar jlesquembre avatar jnothman avatar liuyuuan avatar parantapa avatar robbednark avatar sjl avatar superjamie avatar zeekay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pydoc.vim's Issues

pydoc conflicts with Python filetype script from Vim

I found that pydoc conflicts with the python.vim filetype script that comes with Vim. In my system, this file is /usr/share/vim/vim73/ftplugin/python.vim.

I discovered this because the omnifunc was set to nothing. If I remove pydoc, omnifunc is set again correctly to omnifunc=pythoncomplete#Complete as it always should be.

The thing is that I don't know if two filetype scripts can be executed for some file of a certain type (e.g.: Python), which would solve this issue. We just have to let the original python.vim to run again.

I'm gonna try to look for a solution.

Any suggestion?

<leader>p... map doesn't work on the current buffer

The next lines which enables the mapping <leader>p... do not work if the first file is a Python file, because those autocmd are activated in the next buffer created with a Python file:

au FileType python,man map <buffer> <leader>pw :call ShowPyDoc('<C-R><C-W>', 1)<CR>
au FileType python,man map <buffer> <leader>pW :call ShowPyDoc('<C-R><C-A>', 1)<CR>
au FileType python,man map <buffer> <leader>pk :call ShowPyDoc('<C-R><C-W>', 0)<CR>
au FileType python,man map <buffer> <leader>pK :call ShowPyDoc('<C-R><C-A>', 0)<CR>

And, could be better to use noremap than map, safer?

I am going to fork this project and try to fix it if you want ;-)

By the way, I like the plugin!

Add support for custom mappings

It would be nice if the mappings were done through <Plug> mappings (see :h using-<Plug>).

This way you could create your own maps more easily.

Maybe also / instead the main function s:ShowPyDoc could be made public, e.g. as PydocShowDoc.

Prevents loading of official ftplugin/python.vim (via "b:did_ftplugin = 1")

The python_pydoc.vim file will set b:did_ftplugin = 1, which will prevent the official ftplugin from loading (and setting up the omnifunc variable).

WIthout digging too much into both ftplugins I would say that python_pydoc.vim should either not change b:did_ftplugin or at least handle omnifunc, too.

"bar" documentation not found if imported as "from foo import bar"

When modules are imported as from foo import bar the plugin fails to find the documentation of bar.
For instance, <leader>pw on bar in the following code will result in no Python documentation found:

from foo import bar

my_var = bar(my_args)

while <leader>pW on bar in the following code works as expected:

import foo.bar

my_var = foo.bar(my_args)

__doc__ opening in a split diff window in MacVim

I'm having an unusual problem in that pydoc is opening on the right-hand side of a diff window instead of just in a split. I've checked my vimrc and I haven't redefined the pydoc_open_cmd command. When I do :verbose map K I get:
*@:call ShowPyDoc(expand("<cword>"), 1)<CR> which is correct (I think). I've actually tried to set let g:pydoc_open_cmd = \"tabnew" in my vimrc, but that gives me an error: E127: Cannot redefine function ShowPyDoc: It is in use

Add info about K being position dependent to the docs/comments

I'd suggest adding info to the header documentation in the ftplugin, about the position-dependent behavior of K. Specifically, that it doesn't cross '.' boundaries to the right, only to the left. I can see why you did it that way, and I can see the value, but it wasn't what I was expecting K to do, as it doesn't normally act that way. I didn't discover that I wasn't going to have to remap K or manually use pW until I read the definition of ExpandModulePath :).

Thanks. Quite liking the ftplugin so far.

Vim complains on open

I just checked out the repo and now receive this when opening a Python file: any thoughts? http://cl.ly/0h1y3W0x2I2C1j2H3v1W

Matthews-MacBook-Air:~/code/libgreader$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 30 2011 14:34:38)
MacOS X (unix) version
Included patches: 1-260
Compiled by [email protected]
Huge version with MacVim GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +float +folding -footer +fork() +fullscreen
-gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap
+libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession
+modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm
+mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme
+netbeans_intg +odbeditor +path_extra +perl +persistent_undo +postscript
+printer +profile +python -python3 +quickfix +reltime +rightleft +ruby
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop
+syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse
+textobjects +title +toolbar +transparency +user_commands +vertsplit
+virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu
+windows +writebackup -X11 -xfontset +xim -xsmp -xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -no-cpp-precomp -g -O2 -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -arch x86_64 -D_FORTIFY_SOURCE=1 -I/System/Library/Frameworks/Tcl.framework/Headers -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_DARWIN_C_SOURCE=1
Linking: gcc -L. -L. -Wl,-syslibroot,/Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.7 -arch x86_64 -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lncurses -liconv -framework Cocoa -fstack-protector -L/usr/local/lib -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -framework Python -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby

Installed plugins:
Matthews-MacBook-Air:~/.vim/bundle$ la
total 32
-rw-r--r--@ 1 askedrelic staff 15K Sep 25 21:10 .DS_Store
drwxr-xr-x 7 askedrelic staff 238B Jul 22 06:55 ManPageView/
drwxr-xr-x 4 askedrelic staff 136B Jul 22 06:55 TaskList.vim/
drwxr-xr-x 5 askedrelic staff 170B Jul 22 06:55 lusty/
drwxr-xr-x 4 askedrelic staff 136B Jul 22 06:55 nerdcommenter/
drwxr-xr-x 6 askedrelic staff 204B Jul 22 06:55 nerdtree/
drwxr-xr-x 6 askedrelic staff 204B Nov 6 00:24 pydoc.vim/
drwxr-xr-x 6 askedrelic staff 204B Jul 22 06:55 tabular/
drwxr-xr-x 6 askedrelic staff 204B Jul 22 06:55 tagbar/
drwxr-xr-x 13 askedrelic staff 442B Oct 10 22:23 utilsnips/
drwxr-xr-x 4 askedrelic staff 136B Jul 22 06:55 vim-fugitive/
drwxr-xr-x 7 askedrelic staff 238B Jul 22 06:55 vim-git/
drwxr-xr-x 4 askedrelic staff 136B Jul 22 06:55 vim-matchit/
drwxr-xr-x 3 askedrelic staff 102B Jul 22 06:55 vim-pydoc/
drwxr-xr-x 3 askedrelic staff 102B Jul 22 06:55 vim-python_match/
drwxr-xr-x 3 askedrelic staff 102B Jul 22 06:55 vim-repeat/
drwxr-xr-x 6 askedrelic staff 204B Oct 8 22:48 vim-room/
drwxr-xr-x 4 askedrelic staff 136B Jul 22 06:55 vim-speeddating/
drwxr-xr-x 4 askedrelic staff 136B Jul 22 06:55 vim-surround/
drwxr-xr-x 4 askedrelic staff 136B Jul 22 06:55 vim-unimpaired/
drwxr-xr-x 5 askedrelic staff 170B Jul 22 06:55 zzfuzzyfinder/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.