Vim auto-completion and auto-Prompt

Source: Internet
Author: User

Vim 7.0 and later versions have built-in auto-completion, with the same shortcut key as omnicppcomplete.

CTRL + x Ctrl + O (Intelligent completion)

Or Ctrl + n

Or Ctrl + P,

Or Ctrl + x Ctrl + f (fill in the file name)

CTRL + X is to enter a mode.

 

However, if the omnicppcomplete plug-in is used, you cannot enter "." "->" automatically and intelligently.

 

To automatically complete STL, You need to download the STL source code, generate the tags file from the STL source code, and write the file to vimrc.

 

CTRL +] You can only enter a defined function, not a declared function.

 

Make sure that the VI compatibility mode is disabled and file type detection is allowed:
Set nocp
Filetype plugin on
Generate Tag file
Ctags-r -- C ++-kinds = + p -- fields = + IAS -- extra = + q.
When completing the C ++ file, the omnicppcomplete plug-in requires the Tag file to contain additional C ++ information. Therefore, the ctags command above is different from the one we used previously, it generates additional information for the c ++ language. The meanings of the preceding options are as follows:
-- C ++-kinds = + P: add the function prototype label to the C ++ file.
-- Fields = + IAS: Add Inheritance Information (I), access control information (a) of Class Members, and function fingerprint (s) to the Tag file)
-- Extra = + Q: Add a class modifier to the tag. Note: If this option is not available, the class members cannot be supplemented.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.