tags:

views:

176

answers:

4

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; waid; seach 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!

A: 

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. ;-)

DevSolar
This counts as wasting time and breaking flow: switching to another app and searching means having to use the mouse, move around windows, etc. Not what the question asks for, and not what I'd want if given a choice.
Seth Johnson
I don't see a significant difference between Shift-K for a manpage (@alesplin), <C-X><C-O> (@R.S.Barnes), and Alt-Tab - / - <searchstring>. You might also note that the other two solutions only help you if you have the search string in your code already, while you can look up anything using my method, which I use for many years now. I admitted it is not exactly what the OP asked for, but the way both he and yourself made browser search look more difficult than necessary makes me believe you can't handle more than one app at a time. Strong words, but so is "wasting time and breaking flow".
DevSolar
+4  A: 

This might help:

OmniCppComplete - C/C++ omni-completion with ctags database

Also take a look at this:

C++ code completion

You can also take a look at Vim Intellisense for C++:

Vim Intellisense - C++ Plug-in

Robert S. Barnes
A: 

You could take it from the other side: Use Vimplugin in Eclipse.org. I haven't tried this myself.

olooney
+1  A: 

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.

alesplin