嵌入式之家

 找回密码
 现在注册

QQ登录

只需一步,快速开始

搜索
热搜: ARM cortex
查看: 3954|回复: 0

在pathogen插件管理的基础上安装vim自动补全插件YouCompleteMe

[复制链接]
  • TA的每日心情
    开心
    2020-6-18 22:00
  • 签到天数: 1 天

    [LV.1]初来乍到

    101

    主题

    192

    帖子

    1645

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    1645
    发表于 2016-7-22 16:08:56 | 显示全部楼层 |阅读模式

    1、安装cmake,因为YCM需要cmake的支持:
    1. [root@hellowld bundle]# yum install cmake
    2. ... ...
    3. 已安装:
    4.   cmake.x86_64 0:2.8.12.2-4.el6
    5. 完毕!
    复制代码

    2、切换到目录~/.vim/bundle/
    3、命令行执行如下命令(确保git已安装,否则执行不成功):
    1. git clone https://github.com/gmarik/vundle.git
    复制代码
    4、等待vundle安装成功(下面是安装过程中输出的信息):
    1. [root@hellowld bundle]# git clone https://github.com/gmarik/vundle.git
    2. Initialized empty Git repository in /root/.vim/bundle/vundle/.git/
    3. remote: Counting objects: 3081, done.
    4. remote: Total 3081 (delta 0), reused 0 (delta 0), pack-reused 3081
    5. Receiving objects: 100% (3081/3081), 918.71 KiB | 45 KiB/s, done.
    6. Resolving deltas: 100% (1076/1076), done.
    复制代码
    5、编辑.vimrc,在vimrc中加入如下内容:

    1. <pre>set nocompatible              " be iMproved, required
    2. filetype off                  " required</pre>set rtp+=~/.vim/bundle/vundle/
    3. call vundle#rc()

    4. Bundle 'gmarik/vundle'
    5. <pre>filetype plugin indent on     " required</pre><pre>Bundle 'Valloric/YouCompleteMe'</pre>
    复制代码
    有的资料里是这样写的,里面还包含了几个不知道的插件:
    1. set nocompatible              " be iMproved, required
    2. filetype off                  " required

    3. " set the runtime path to include Vundle and initialize
    4. set rtp+=~/.vim/bundle/vundle/
    5. call vundle#rc()
    6. " alternatively, pass a path where Vundle should install plugins
    7. "let path = '~/some/path/here'
    8. "call vundle#rc(path)

    9. " let Vundle manage Vundle, required
    10. Plugin 'gmarik/vundle'

    11. " The following are examples of different formats supported.
    12. " Keep Plugin commands between here and filetype plugin indent on.
    13. " scripts on GitHub repos
    14. Plugin 'tpope/vim-fugitive'
    15. Plugin 'Lokaltog/vim-easymotion'
    16. Plugin 'tpope/vim-rails.git'
    17. " The sparkup vim script is in a subdirectory of this repo called vim.
    18. " Pass the path to set the runtimepath properly.
    19. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
    20. " scripts from http://vim-scripts.org/vim/scripts.html
    21. Plugin 'L9'
    22. Plugin 'FuzzyFinder'
    23. " scripts not on GitHub
    24. Plugin 'git://git.wincent.com/command-t.git'
    25. " git repos on your local machine (i.e. when working on your own plugin)
    26. Plugin 'file:///home/gmarik/path/to/plugin'
    27. " ...

    28. filetype plugin indent on     " required
    29. Bundle 'Valloric/YouCompleteMe'
    复制代码

    6、安装插件,打开一个空白的vim编辑窗口,执行命令BundleInstall:
    1. [root@hellowld ~]# vim
    复制代码
    1. :BundleInstall
    复制代码
    等待下载完成... ...

    7、切换到~/.vim/bundle/YouCompleteMe/

    8、执行下列安装命令
    1. [root@hellowld YouCompleteMe]# ./install.sh --clang-completer --omnisharp-completer
    复制代码
    YCM开始装,这里的两个参数--clang-completer支持c/c++。--omnisharp-completer支持c#





    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 现在注册

    本版积分规则

    QQ|Archiver|手机版|小黑屋|嵌入式之家 ( 京ICP备14038168号-1 )

    GMT+8, 2024-5-10 12:49 , Processed in 0.019149 second(s), 26 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表