vimdebianyoucompleteme

Vim youcompleteme not working in Debian Jessie


According to this article code completion should work for any language with youcompleteme plugin. I set it up as follows in Debian Jessie:

  • installed vim from repository
  • installed youcompleteme from repository
  • issued 'vam install youcompleteme' in cli

After the last step vim start significantly slower, which means that it is loading the plugin. However, completion does not work. The output of

$ vam status
Name                     User Status  System Status 
editexisting                removed       removed       
justify                     installed     removed       
matchit                     removed       removed       
youcompleteme               installed     removed       

Is there anything else I have to do to get youcompleteme working?


Solution

  • I contacted the maintainer and finally got the missing hint. As it turns out, all I had left to do was to enable filetype recognition. In case someone else struggles with this, here are some instructions on how to setup Vim with the Debian package vim-youcompleteme.

    Install vim and vim-youcompleteme packages

    $ sudo apt-get install vim vim-youcompleteme
    

    This will also install any required dependencies automatically. Afterwards you will have to issue the following command

    $ vam install youcompleteme
    

    The last command will create ~/.vim folder in your home folder. However, code completion does not work yet. Some further modifications are required. First copy the default ycm_extra_conf.py file to the newly created ~/.vim/ folder

    $ cp /usr/share/doc/vim-youcompleteme/examples/ycm_extra_conf.py ~/.vim/.ycm_extra_conf.py
    

    Then we need to tell vim to use this file for code completion in our .vim.rc and to turn on filetype recognition. The following two lines should be added to ~/.vimrc:

    let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
    filetype on
    

    Now vim should be able to use code completion, e.g., with C++ files.