In my .vimrc
and my vim plugin UltiSnips I've got a lot of code that looks like that
:py << EOF
print("Hi")
EOF
Now, I want to check if python3 is compiled into Vim via has("python3")
and then use :py3
instead of :py
. Keeping the python code compatible between python 2 and 3 is not the issue - the issue is to tell vim to use :py3 if is available and :py otherwise.
Has someone a good idea?
if has("python3")
each time you want to use:py3
. – Likkerif
. – Likker