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 YouCompleteMe under Linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces how to install YouCompleteMe under Linux, the article is very detailed, has a certain reference value, interested friends must read it!

YouCompleteMe is a very useful plugin for vim, whose main function is code completion.

Version: Ubuntu 20.04 LTSgit

First, check whether git is installed on your system. Many libraries require git, including code management through git when we write our own code. Use git --version to check if git is installed. If the terminal returns a git version, congratulations. If no terminal prompt command is found, enter sudo apt-get install git in the terminal and the progress bar is finished, and git is installed successfully.

cmake

Check if cmake is present in the system in the same way, and if not, the final compilation step will give an error. Also enter sudo apt-get install cmake on the terminal to install

Vundle

Using Vundle for vim plugin management is a good option. For this step we use git. Enter git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim in terminal and wait for system completion

.vimrc

Create your.vimrc file. With.vimrc, add the following code at the beginning of the file:

set nocompatible "required filetype off "Required" Set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vimcall bundle #begin()"Make Vuldle manage itself Plugin 'VundleVim/Vundle.vim'" Last place to write YouCompleteMe management statement "All your plugins must add call bundle #end() before this line " requiredfiletype plugin indent on " required

Start vim and type:PluginInstall

The front is all preparatory work, and then the official installation of YCM

Enter the following command

cd ~/.vim/bundlegit clone https://github.com/ycm-core/YouCompleteMe.git

After downloading, enter cd ~/.vim/bundle/YouCompleteMe under the YCM directory and enter the following command git submodule -init -recursive. This process will take a long time. Wait patiently.

After the above, start compiling all languages supported by YCM: ① ./ install.py

The installation process is also slow and resistant to new waiting. After compilation, add: Plugin 'ycm-core/YouCompleteMe' to.vimrc and run it again:PluginInstall, installation is complete

Now create a vim file and start typing code. Is there a code prompt?

1: Possible problems

In progress.../ Error will be reported when install.py

//This is my version Searching Python 3.8 libraries... Found Python library: /usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so

Solution: sudo apt-get install python 3-dev if still not possible

sudo apt-get updatesudo apt-get install -y build-essential

Run this again./ install.py, wait for the end.

The above is "How to install YouCompleteMe under Linux" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!

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

Development

Wechat

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

12
Report