Vim uses the
pydoc command to display Python help, so if your system has a
pydoc that defaults to Python 3, its setup will work as expected out of the box.
But I imagine that's perhaps not the case with Mac OS X and Python 3 from Homebrew. So you can consider updating your Vim setup to use a more appropriate
pydoc that matches your system.
This setting is controlled by the
The Python filetype support shipped with Vim doesn't allow much customization for this particular option, so the best way for you to override it is to write your own custom Python filetype plug-in, that will run after the one in Vim runtimes, that will override
'keywordprg' to the setting that makes sense to your system.
Create a file named
~/.vim/after/ftplugin/python.vim and add this single line to it:
That's assuming you can use a
pydoc3 command that's in your
$PATH to look up Python 3 docs. If that's not the right command, update to one that will work for you. You can use a full path if needed. If you need spaces, escape them with backslashes. Example:
setlocal keywordprg=/usr/local/bin/python3\ -m\ pydoc