Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using VIM for C++/Qt development w/ Autocomplete

At work, I mainly program in C++ and when it needs to be graphical/multi-threaded/network enabled use Qt. Our environment is windows and I currently program w/ a combination of Visual Studio(debuggin purposes only) and Qt-Creator for actual coding (like their autocomplete better than VS).

At home, I mainly use linux (fedora) and still use Qt-Creator as I haven't found an alternative. I use VIM for pretty much everything else (editor wise) and basically LOVE everything about it.

I want to be able to use VIM for my programming (both at home AND work) but find that I'm not as productive without autocomplete.

Anyone have a good tutorial, forum post, or personal experience on how to get 'good' autocomplete (yes... not exactly very descriptive... 'good'...) for C++ and Qt in VIM? I believe it is very for linux/vim/qt/c++ but is it also possible for windows?

Thanks

like image 329
g19fanatic Avatar asked Nov 18 '10 12:11

g19fanatic


2 Answers

Take a look at this: http://vim.wikia.com/wiki/VimTip1608
A pain to configure, but after all you'll get VS-like autocompletion + all the tasty omnicompletion stuff like Ctrl-P to complete the word, Ctrl-X-Ctrl-L to complete the line etc.

like image 165
buru Avatar answered Sep 27 '22 21:09

buru


I don't think I have any magic settings in my vimrc which enables this, but I can just start typing and then (while still being in insert mode) press Ctrl+N to have vim suggest completions. It seems to check the open buffers for possible completions. It's not perfect, but in 98% of the cases it does what I want and there's no setup work needed.

like image 45
Frerich Raabe Avatar answered Sep 27 '22 20:09

Frerich Raabe