Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install the YouCompleteMe plug-in using the Linux system Vim Editor

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "how to use the Linux system Vim editor to install the YouCompleteMe plug-in", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "how to use the Linux system Vim editor to install the YouCompleteMe plug-in"!

Compile configuration options:

/ configure-with-features=huge-enable-pythoninterp-enable-python3interp-enable-luainterp-enable-multibyte-enable-sniff-enable-fontset

I have python2.7.5 and python3.3 on my machine, but I still don't support py3 with the enable-python3interp parameter. Somehow, YouCompleteMe only requires more than py2.6.

Install the vundle plug-in

Git clone https://github.com/gmarik/vundle.git ~ / .vim/bundle/vundle

Configure in .vimrc

Set nocompatible "be iMproved, required

Filetype off "required

"set the runtime path to include Vundle and initialize

Set rtp+=~/.vim/bundle/vundle/

Call vundle#rc ()

"alternatively, pass a path where Vundle should install plugins

"let path ='~ / some/path/here'

"call vundle#rc (path)

"let Vundle manage Vundle, required

Plugin 'gmarik/vundle'

"The following are examples of different formats supported.

"Keep Plugin commands between here and filetype plugin indent on.

"scripts on GitHub repos

Plugin 'tpope/vim-fugitive'

Plugin 'Lokaltog/vim-easymotion'

Plugin 'tpope/vim-rails.git'

"The sparkup vim script is in a subdirectory of this repo called vim.

"Pass the path to set the runtimepath properly.

Plugin 'rstacruz/sparkup', {' rtp': 'vim/'}

"scripts from http://vim-scripts.org/vim/scripts.html

Plugin 'L9'

Plugin 'FuzzyFinder'

"scripts not on GitHub

Plugin 'git://git.wincent.com/command-t.git'

"git repos on your local machine (i.e. When working on your own plugin)

Plugin 'file:///home/gmarik/path/to/plugin'

". No, no, no.

Filetype plugin indent on "required

Bundle 'Valloric/YouCompleteMe'

Save exit, open vim, type: BundleInstall to install automatically

The process is as follows. The + sign indicates that it has been installed, and "indicates that it is being installed."

. Plugin 'gmarik/vundle' | ~

+ Plugin 'tpope/vim-fugitive' | ~

+ Plugin 'Lokaltog/vim-easymotion' | ~

+ Plugin 'tpope/vim-rails.git' | ~

+ Plugin 'rstacruz/sparkup' | ~

+ Plugin 'L9' | ~

+ Plugin 'FuzzyFinder' | ~

"Plugin 'git://git.wincent.com/command- | ~

T.git' | ~

Plugin 'file:///home/gmarik/path/to/pl|~

Ugin' | ~

Plugin 'Valloric/YouCompleteMe' | ~

Helptags

Note: there is an error at the end, which is normal, because ycm needs to compile the library file manually.

Done! With errors; press l to view log

Ycm_client_ support. [so | pyd | dll] and ycm_ core. [so | pyd | dll] not detected; you need

To compile YCM before using it. Read the docs!

To .vim / bundle/YouCompleteMe

/ install.sh-- clang-completer

The parameter is used to support the completion of cCompact +.

After the installation is complete, you can use it with some simple configuration.

The completion configuration file for YouCompleteMe is in / bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py, which is a hidden file.

This file is used by default, or you can copy it to the root directory of the project to make changes. When you open the project file, you will give priority to using the configuration file in the current directory.

If it cannot be found, it will be looked up according to the ycm_global_ycm_extra_conf in the configuration.

Add in .vimrc

Let mapleader = "," this leader is mapped to a comma, "

Let g:ycm_global_ycm_extra_conf ='~ / .vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' "configure the default ycm_extra_conf.py

Nnoremap "leader" jd: YcmCompleter GoToDefinitionElseDeclaration "CR"press, jd will jump to the definition

Let g:ycm_confirm_extra_conf=0 "opens vim without asking if you want to load the ycm_extra_conf.py configuration

Let g:ycm_collect_identifiers_from_tag_files = 1 "tags file generated using ctags

This is how Linux installs the YouCompleteMe plug-in for Vim. The YouCompleteMe plug-in is known as the Vim automatic completion artifact, which is very important for Vim.

At this point, I believe you have a deeper understanding of "how to use the Linux system Vim editor to install the YouCompleteMe plug-in". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report