UltiSnips is the plugin for Vim that I use the most. It allows for the creation of macros (named snippets) that insert predefined chuncks of text at the desired location in a file. These snippets automate the insertion of repetitive lines of code. They can be very simple like the following one which write the necessary C++ code to print text to the console:

UltiSnips simple snippet

They can be much more complex like this one which creates the header for a C++ class:

UltiSnips complex snippet

UltiSnips requires Python3 to run. Thus, Vim must have been compiled with Python3 support. To check, start Vim with the --version argument.

Vim Version on Cygwin

Fortunately, this is the case for the version of Vim found in the Cygwin repo.

It is not enough to have installed Python for UltiSnips to work out of the box. We need to have installed the same version that Vim was compiled for. To check that the link between Vim and Python works proprely, we can simply try to run any Python expression in Vim using the :python3 command. 1

Finding the Python version in Vim on Cygwin

If the Vim/Python link is correct, the command will be executed without any error. Otherwise, an error message will be displayed at the bottom of the window.

Error message showing the Python version in Vim on Cygwin

We see here that Vim is looking for Python 3.7. We just need to start the Cygwin installation app and install the python37 package.

Python37 Package on Cygwin

Once installed, UltiSnips should properly work.

  1. UltiSnips does not support Python2 since commit d2f42d6. It is thus important to use the :python3 command for our test.