Vim Auto-complete function:

Source: Internet
Author: User

Record your own youcompleteme installation steps:

Vim does not have the code auto-completion function is very uncomfortable.

1, first clear: The MAC comes with Vim is 7.3 version, and Youcompleteme installation requires more than 7.3 version of Vim.

The problem with the Vim installation Youcompleteme with Mac comes in the following:

2, install the youcompleteme before installing the Budle plug-in (Vundle plug-in):

Vundle plug-in installation is relatively simple:

Paste the following code at the top of the $HOME/.VIMRC file:

Set nocompatible"RequiredFileType off"Required"set the runtime path to include Vundle and initializeSet rtp+=~/.vim/bundle/vundle.vimcall vundle#begin ()"Alternatively, pass a path where vundle should install plugins"Call vundle#begin (' ~/some/path/here ')"Let Vundle manage Vundle, requiredPlugin'Gmarik/vundle.vim'"Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)"All of your Plugins must is added before the following lineCall Vundle#end ()"RequiredFileType plugin indent on"Required

After the code is set up, then open a vim and enter it in command mode:PluginInstall  

The plugin is automatically installed, and a. Vim folder is generated under $home/,

All plug-in files are installed in the./vim/bundle/file.

You can install the plug-in using Budle.

Bundle ' Valloric/youcompleteme '

The Bundle statement must be between call Vundle#begin () and call Vundle#end (), and cannot be placed in the wrong place.

Then open up a vim and enter it in command mode: Bundleinstall  就可以自动安装插件了。

3, because the Mac comes with the Vim version is not enough, all installed Macvim,

To install using homebrew:

Brew Install Macvim

After using Brew to install Macvim successfully, use the command: Brew Linkapps Macvim to generate Macvim app flags (command line prompts)

Because Macvim and vim use the same. VIMRC configuration file. (can also be set to use Macvim instead of the original vim, I did not set this)

On the command line: Mvim can open the Macvim interface.

To install a successful CD ~/. Vim/bundle/youcompleteme

. /Install --clang-completer

Also install a cmake first:

Brew Install CMake

are installed afterwards. As described in 2, the configuration is complete, and after the installation Youcompleteme succeeds, the Youcompleteme folder is generated under $home/.vim/bundle, as shown in:

Perform the command to install the auto-complete function:

CD ~/. Vim/bundle/youcompleteme

./install.py-clang-completer: With C language complement function

./install.py-omnisharp-completer:c# complement function

./install.py-all All

PS: Attach several RELATED links

1. Vim and Python are the true days of the day

2. Vundle documentation on GitHub

3, Youcompleteme

4. Shortcut keys on Mac:

SHIFT + COMMAND + 4: Custom

SHIFT + COMMAND + 3: fullscreen

5. Vim--version, Mvim--version view vim version

6, the installation process may be wrong, carefully look at the installation tips, even if a step to install the success of self-study to see the installation tips, English is very useful ah

Vim Auto-complete function:

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.