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:
libclang. Since version 10.0, FreeBSD ships
clangas a compiler, but not
libclangitself. I installed
sudo pkg install clang35or
sudo portinstall clang35) which installs the library.
- Install vundle, the plugin manager.
- Use vundle to install YCM as explained in its site. It’s really simple
- Install all the needed libraries:
sudo pkg install boost-libs boost-python-libs
- By default, YCM doesn’t find the boost libraries, so we need to help it a little:
- Go to
./install.sh --clang-completer --system-libclang --system-boost. After this, you’re almost done
- Copy the .ycm_extra_conf.py 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.