5

I want to develop C/C++ programs, so I installed YouCompleteMe for Vim through Vundle.but it can't work normally, In fact, it shows only the words contained in the current file.hope to help! my step are as follow:

  • download Vundle.vim
    git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  • #modify .vimrc

    set nocompatible
    filetype off
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Plugin 'gmarik/Vundle.vim'
    Plugin 'Valloric/YouCompleteMe'
    call vundle#end()
    filetype plugin indent on

  • Launch vim and run:
`:PluginInstall`
  • download cmake and clang+llvm

    http://llvm.org/releases/download.html#3.6.0
    http://www.cmake.org/download/

  • prepare clang and cmake

    Extract "clang+llvm-3.6.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz" into ycm_temp
    Rename "clang+llvm-3.6.0-x86_64-linux-gnu" to "llvm_root_dir"
    Extract cmake-3.2.2-Linux-x86_64.tar.gz and Link bin/cmake to /usr/bin/cmake

  • make

    cd ~
    mkdir ycm_build
    cd ycm_build
    cmake -G "Unix Makefiles" -DPATH_TO_LLVM_ROOT=~/ycm_temp/llvm_root_dir . ~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp
    make ycm_support_libs

  • modify .vimrc

    let g:ycm_seed_identifiers_with_syntax=1
    let g:ycm_global_ycm_extra_conf = '/home/li/.vim/bundle/YouCompleteMe/.ycm_extra_conf.py'
    let g:ycm_confirm_extra_conf=0
    let g:ycm_collect_identifiers_from_tag_files = 1
    set completeopt=longest,menu

Now, No error or warn be thrown, but it can't autocomplete C/C++ header files!

  • Note
OS:ubuntu 14.04
vim:7.4
Python:2.7.6
6
  • Did you run ./install.sh --clang-completer?
    – FDinoff
    May 6, 2015 at 3:36
  • yes, I have just run, but the problem is still...
    – wengang li
    May 6, 2015 at 5:12
  • What is the output of :YcmDebugInfo?
    – FDinoff
    May 6, 2015 at 5:13
  • Printing YouCompleteMe debug information... -- Server has Clang support compiled in: True -- Clang version: clang version 3.6.0 (tags/RELEASE_360/final) -- Server running at: 127.0.0.1:41583 -- Server process ID: 2549
    – wengang li
    May 6, 2015 at 5:15
  • Use the plugin's issue tracker.
    – romainl
    May 6, 2015 at 5:55

1 Answer 1

5

Check with shortcut Ctrl-X + Ctrl-O for omni completion (function).

It will trigger omni function,

and/or download .ycm_extra_conf.py from the following link >> https://github.com/rasendubi/dotfiles/blob/d534c5fb6bf39f0d9c8668b564ab68b6e3a3eb78/.vim/.ycm_extra_conf.py

and place it inside .vim, then add the following to .vimrc

let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'

1
  • If it solves your problem, please marked as solved... :)
    – sugab
    May 27, 2015 at 9:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.