Installing YouCompleteMe on FreeBSD

Recently, we had a discussion at work about editors and IDEs. And yes, I think Vim is not only a great editor but also a good IDE with the proper plugins installed.

There are several nice plugins out there, but I’m going to talk about YouCompleteMe. YouCompleteMe (in short, YCM), is a completion engine for Vim that uses libclang as a backend to support great C/C++ semantic completion. Unlike other pure Vim plugins, YCM needs a component that has to be compiled before you get semantic completion. Although it is not complicated, I’ll show you the steps to successfully install YCM in your FreeBSD:

  1. Install libclang. Since version 10.0, FreeBSD ships clang as a compiler, but not libclang itself. I installed clang35 (sudo pkg install clang35 or sudo portinstall clang35) which installs the library.
  2. Install vundle, the plugin manager.
  3. Use vundle to install YCM as explained in its site. It’s really simple
  4. Install all the needed libraries: sudo pkg install boost-libs boost-python-libs
  5. By default, YCM doesn’t find the boost libraries, so we need to help it a little: export LD_LIBRARY_PATH=/usr/local/llvm35/lib/
  6. Go to .vim/bundle/YouCompleteMe and execute ./ --clang-completer --system-libclang --system-boost. After this, you’re almost done
  7. Copy the file to your home directory and tweak it at your own discretion. I can’t help you much here since your configuration will depend on the project and the language you are using.



  • On 04.29.17 Frederick Ollinger said:

    I had to rebuild vim with python support for this to work.

  • On 04.29.17 Frederick Ollinger said:

    I also had to install cmake.

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*Required Fields