Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Vim useful plugin: YouCompleteMe     - Lenovo Ultrabooks Ubuntu system can not open the wireless hardware switch solutions (Linux)

- Define and modify strings principle in Python (Programming)

- Share and show your code on GitHub (Linux)

- Digital jQuery scrolling effect (Programming)

- Remote database using RMAN recovery test (RAC return to single-instance database) (Database)

- apt-get install openstack pkg Troubleshooting (Linux)

- Linux Kernel 4.2.2 compiler installation tutorial (Linux)

- Deb package installation method under ubuntu (Linux)

- Spark read more HBase tables a RDD (Server)

- JavaScript in this usage (Programming)

- Linux Operating System Security Study (Linux)

- Java Access Control (Programming)

- Asynchronous JavaScript loading (Programming)

- AngularJS - Custom instructions (Programming)

- Linux shell in back quotes (`) Application (Linux)

- Android Service service applications and the phone SMS Listener Listener (Programming)

- GNU / Linux system, how to clean up memory space (Linux)

- Linux find and xargs (Linux)

- CentOS 6.5_x64 install Oracle 11g R2 (Database)

- 25 Git Advanced Skills (Linux)

  Vim useful plugin: YouCompleteMe
  Add Date : 2017-01-08      
  Vim Code Completion Status

Vim in the long history of the development, code completion has been relatively neglected areas, as compared to many IDE, vim itself of its many features include code hints completion plugin seems very simple, because vim deficiencies, it is text The compiler can not understand the program semantics. Wang Yin cited a passage:

"Text Editor" Usually this kind of thing does not really understand the programming language. Many Emacs and vi users that the use of such tools can make them etags and ctags "Go to Definition", but these tags tool is only the program "Text" do something stupid regular expression matching. They do not have a program parse, it is only after some "guessing." Simple function definition they might be able to guess the location, but for a definition of the same name, or local variables when they are insufficient.

Perhaps for python, PHP and other dynamic language, because the language itself the characteristics and rich tool support, can do a good complement effect, but for C / C ++ code completion, AutoComplPop, omnicppcomplete, neocomplcache and other plug-ins do They are "guessing."

Another reason is no big cow to do these functions. In the long history of Vim or emacs, which are in the hands of a small elite programmers to expand it requires a certain expertise, but in my generation common programmer to use it. The code completion is not large cattle must be, and I have a Swedish PSE doing Pair Programming, only use emacs or grep linux command, he can surf throughout the project, invoke the common repository clear in mind clear code structure, almost no grammar and spelling mistakes. I guess he saw the bells and whistles of vim, also used code hints, and my heart is a burst of contempt of it. So despite the large cattle coffee can make emacs, vim can be made to it, but the vim and emacs code hints always rotten three decades.

Apply after the company supports LLVM / clang born, things ushered in a turning point. clang powerful semantic analysis capabilities for C / C ++ / Object-C source-level analysis and conversion offers the possibility, began to clang-based semantic completion plugin in vim and emacs.


YouCompleteMe is a relatively new Vim code completion plugin can provide code hints based clang of C / C ++ code. It installs a simple configuration, with little Bug. For C / C ++ for youcompleteme now is the best choice, with the clang of powerful complement efficiency and high accuracy, and can be fuzzy match (see below for demo). Whatever weird wording you use C ++ code, as long as the compiler, can complement, even C ++ lambda and auto 11 are no barriers, according to the tag index complement the IDE more powerful than codeblock.

YCM installation configuration

YCM requires the latest version of Vim (7.3.584) support from the code to compile Vim way to look at this.
After using Vundle installation youcompleteme, you need to be compiled before use.

cd ~ / .vim / bundle / YouCompleteMe
./install.sh --clang-completer

Semantic complement to work properly, you need to configure .ycm_extra_conf.py file template here. You can put this file in the root directory of the project, the project file is opened, YCM will cycle up search and load the file, or adding vimrc file

let g: ycm_global_ycm_extra_conf = 'your path to .ycm_extra_conf.py'

If .ycm_extra_conf.py in other configurations include path is no problem, YCM already working.

YCM updated very frequently, and UltiSnip recent versions already integrated.

2013-08-14 update

Integrated Syntastic

YCM has long supported integration Syntastic, the above demo which appeared before the red cross on the code is YCM combined Syntastic broke grammatical mistakes. Beginning with YCM time, pay more attention to its code completion, Syntastic did not mind, and found that the more you use the more inseparable. When writing C ++ code every time the cursor hovers over 2 seconds when, YCM will scan your current file in the background, the code you have just entered what compilation error, you can immediately show up in time to get rid of, not accumulate to the last compile time. Of course, this is a standard feature of modern IDE, vim also has a plug-in can be achieved, but with YCM later, and then install vundle Syntastic, even without any configuration to achieve these functions, it is too convenient.

Skip Code

YCM support code jumps, and yet another program to develop a very useful feature now supports c, cpp, object-c, object-cpp, python code branches to the declaration and implementation. Especially for c and c ++, this jump is not like those based on plug-ctags, often let you in a lot of the same name tag Azeri flesh search, ten nine do not jump in. Benefited clang of powerful, YCM code jumps almost nothing went wrong, of course, the premise is you have to set up .ycm_extra_conf.py, not too many errors when compiling code is parsed YCM.

The main function is to three YcmCompleter of subcommands:

In vim configuration file, add a line to get

nnoremap jd: YcmCompleter GoToDefinitionElseDeclaration
- Construction of Android and iOS apps use Jenkins Automation (Programming)
- Oracle 12C RAC optimizer_adaptive_features cause of data into overtime (Database)
- Android 4.2 compilation notes (Programming)
- React Getting Started Tutorial (Linux)
- HTTPS and SSH and use the difference between the way: Git User's Manual (Linux)
- How to merge two pictures in Cacti (Linux)
- File sharing and fork function (Programming)
- Bash Automated Customization Linux belongs to its own CentOS system (Linux)
- C ++ Object Model Comments (Programming)
- pdf.js Tutorial (Linux)
- VMware clone Linux find eth0 (Linux)
- Linux iptables firewall settings (Linux)
- On Android running ClojureScript (Linux)
- Summarize small problems encountered in the use Lua (Programming)
- Node.js development environment deployment (Server)
- Linux under HAProxy + Keepalived dual-availability program (Server)
- Use the command line MySQL database backup and recovery (Database)
- JavaScript basic types and type conversion (Programming)
- Teach you how to synchronize Microsoft OneDrive in Linux (Linux)
- Windows 7 hard disk to install Ubuntu 15.04 (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.