looking up c++ documentation inside of vim

Viewed 7651

I code c++, using vim.

Often times, I find myself wasting time (and brekaing flow) looking up trivial things like:

is std::string.substring does it take (start, length) or (start, end).

This often results in open browser; wait; search on google; first link useless, try second link; okay, done.

How do others do this in vim? Is there a nice *.tgz I can download of standard function documentation and somehow reference them inside of vim?

Thanks!

6 Answers

I don't program in C++, but if there are man pages for the functions in question, you can access them by placing the cursor over the function name and hitting ShiftK. This only works for functions that have a man page installed, so your mileage may vary.

Not really an answer as it is not "inside vim"... but why don't you cut the "open browser, search Google" part? Just point your browser at a good API documentation, and keep it open. http://www.dinkumware.com/manuals/default.aspx is my favourite (which can be downloaded for offline reference, too), http://www.cplusplus.com/reference/ is not bad either. A window switch and two or three clicks later you have your answer; I doubt an "inside vim" solution could be much less disruptive to your workflow.

That being said, having a solution inside vim would be nice for those who are working on a text-only interface, so I am looking forward to the other answers. ;-)

Related