Install the YouCompleteMe plug-in and the Python plug-in jedi-Vim in vim.

Source: Internet
Author: User

Install the YouCompleteMe plug-in and the Python plug-in jedi-Vim in vim.
1. Install YouCompleteMe

1. Install the vundle plug-in
Git clone ~ /. Vim/bundle/vundle
2. Install YouCompleteMe
Add the following in. vimrc:
Bundle 'valloric/youcompleteme'
Enter vim and enter:
: BundleInstall
Then wait for the installation ........
An error occurs at the end. This is normal because ycm needs to manually compile the warehouse picking file.
Cd ~ /. Vim/bundle/YouCompleteMe &./install. sh
There seems to be an error during this period, prompting you to install cmake. Follow the prompts to install it.

CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):  Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)  (Required is at least version "2.6")

This error indicates that python-dev is not installed.
Run sudo apt-get install python-dev.

After installation, add the following configuration in. vimrc:

"Youcompleteme default tab s-tab conflicts with auto-completion" let g: ycm_key_list_select_completion = ['<c-n>'] let g: ycm_key_list_select_completion = ['<Down>'] "let g: Keys = ['<c-p>'] let g: ycm_key_list_previus_completion = ['<Up>'] let g: ycm_confirm_extra_conf = 0 "Disable loading. prompt let g: ycm_collect_identifiers_from_tags_files = 1 "enable YCM Based on the label engine let g: labels = 2" starts listing the matching items from 2nd characters. let g: ycm_cache_omnifunc = 0 "indicates that cache matching items are prohibited. Each time, the matching item let g: ycm_seed_identifiers_with_syntax = 1" syntax keyword completion nnoremap <F5>: ycmForceCompileAndDiagnostics <CR> "force recomile with syntastic" nnoremap <leader> lo: lopen <CR> "open locationlist" nnoremap <leader> lc: lclose <CR> "close locationlistinoremap <leader> <C-x> <C-o>" can also complete let g in the comment input: ycm_complete_in_comments = 1 "the string input can also be supplemented with let g: ycm_complete_in_strings = 1" the comment and the text in the string will also be supplemented with the income of let g: bytes = 0
Ii. Install the jedi plug-in

1. Install jedi-vim
Add the following in. vimrc:
Bundle 'David halter/jedi-vim'
Run BundleInstall in vim.
2. Install the jedi Module
Sudo pip install jedi
The installation is complete.

Gethub configurations:

Jedi is by default automatically initialized. If you don't want that I suggest you disable the auto-initialization in your. vimrc:

Let g: jedi # auto_initialization = 0

There are also some VIM options (like completeopt and key defaults) which are automatically initialized, but you can skip this:

Let g: jedi # auto_vim_configuration = 0

You can make jedi-vim use tabs when going to a definition etc:

Let g: jedi # use_tabs_not_buffers = 1

If you are a person who likes to use VIM-splits, you might want to put this in your. vimrc:

Let g: jedi # use_splits_not_buffers = "left"

This options cocould be "left", "right", "top", "bottom" or "winwidth". It will decide the direction where the split open.

Jedi automatically starts the completion, if you type a dot, e.g. str., if you don't want this:

Let g: jedi # popup_on_dot = 0

Jedi selects the first line of the completion menu: for a better typing-flow and usually saves one keypress.

Let g: jedi # popup_select_first = 0

Jedi displays function call signatures in insert mode in real-time, highlighting the current argument. the call signatures can be displayed as a pop-up in the buffer (set to 1, the default), which has the advantage of being easier to refer, or in Vim's command line aligned with the function call (set to 2), which can improve the integrity of Vim's undo history.

Let g: jedi # show_call_signatures = "1"

Here are a few more defaults for actions, read the docs (: help jedi-vim) to get more information. If you set them to "", they are not assigned.

NOTE: subject to change!

Let g: jedi # goto_command = "d"
Let g: jedi # goto_assignments_command = "g"
Let g: jedi # goto_definitions_command = ""
Let g: jedi # documentation_command = "K"
Let g: jedi # usages_command = "n"
Let g: jedi # completions_command = ""
Let g: jedi # rename_command = "r"

Finally, if you don't want completion, but all the other features, use:

Let g: jedi # completions_enabled = 0

For more Vim tutorials, see the following:

Vim Learning Guide

Quick learn Vi Editor

Powerful Vim Editor

Build a Vim Development Environment on CentOS 6.2

Make Vim an excellent C ++ IDE

Vim tips: C language settings

Set the Vim row number in Ubuntu

This article permanently updates the link address:

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: 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.