问题
Is it possible to make Vim complete the code for you, like in any other IDE (not just word searching, but members of classes, methods etc.)?
What are the best options / plugins available?
回答1:
It's possible, but most people don't.
vim is a fairly generic editor, that said, it does contain some "code completion" features such as word completion, etcetera, but nothing like the likes of, say, Delphi's IDE.
Such a system could be added by scripting vim - vim can directly run several scripting languages that make this easy, or you could send the file through an external script.
回答2:
Clang Complete lets you use Clang for accurate auto-completion of C and C++
回答3:
I believe that following this list of links you will be able to leave any IDE and become a faithful user of vim, see some plugins that help you with IDE resources...
- snipMate plugin faster code complete skels
- video showing snipmate on vimeo
- article about sparkup html codding to understand this resource
- video showing sparkup html complete to see this in action
- Auto complete popup plugin here
- Advanced undo resource
- some interesting videos on advanced usage of vim on vimeo
- more free videos at vimcasts.org
- amazing article about vim in this link
- vim for php programmers (useful not only for php programmers) here
回答4:
This is a little out dated. A rising star in Vim code completion is the "YouCompleteMe" plugin. Check it out here.
回答5:
Omni completion is definitely the way to go. Instantiate it in insert mode with Ctrl+X Ctrl+O.
I use it in conjunction with SuperTab as well to allow for tab completion similar to bash shell.
回答6:
Don't use it myself but I have heard of Omni complete:
http://vim.wikia.com/wiki/Omni_completion
The Vim Wiki contains a couple of things that may be of use for auto completion of words.
回答7:
You can try this out Dictionary completions, get dictionary for you language. Simple ways
if you are programming in c++, there are ctag and cscope and with OmniCppComplete plugin.
Hope it will help
来源:https://stackoverflow.com/questions/4823758/vim-code-completion