Vim Configuration

If you are interested, my Vim configuration can be found in https://ufal.mff.cuni.cz/~straka/vimrc/vimrc.tar.xz.

It is not well documented, but some information about Python and C++ completion follow.

Python Completion

Python completion is available in the above archive and also in https://ufal.mff.cuni.cz/~straka/vimrc/vimrc.pythoncomplete.tar.xz, which contain a modest .vimrc and plugins required only for Python completion.

Apart from Vim with Python3 support, Python completion does not require any further initialization. The completion is not started automatically; to use it:

  • in insert mode, press Alt+Space or Ctrl+X Ctrl+O to start the completion;
  • additionally, you can use Ctrl+X Ctrl+A (either during opened completion or just in insert mode) to start the completion in a mode when all arguments are inserted apart from just the function name;
  • in insert mode, press Alt+= to open documentation for the innermost open function (e.g., you can use it after the open bracket of a function call). If the documentation is long, you can use Alt+= and Alt+- to scroll through it.

If you would like the completion to be opened automatically after a dot, move the "." in the .vimrc file on line containing au FileType python call ComplHookInit from the third argument to the first argument.

C++ Completion

C++ completion is available in the above archive and also in https://ufal.mff.cuni.cz/~straka/vimrc/vimrc.cppcomplete.tar.xz, which contain a modest .vimrc and plugins required only for C++ completion.

The completion uses libclang.so from Clang, which you must install separately and symlink it as .vim/plugin/libclang.so.

The completion is opened automatically after . -> :: and is otherwise controlled in the same way as Python completion.

By default, C++11 is used as the language variant. You can either change the default in the .vimrc file or you can use per-project configuration file .clang_complete containing Clang compiler options including for example -std=c++17.