This question already has an answer here:
I feel like this might be because of my lack of vimscript knowledge. Basically I want to write a patch for this plugin https://github.com/actionshrimp/vim-xpath to make it work for python3 (and hence vim8).
I can just change it to say py3 everywhere it currently says py however that breaks it for python2 and so wouldn't be submittable as a pull request.
I don't want to litter the code with if/else
has("python3") everywhere - ideally I'd like to assign the relevant command to a variable in an if else and then just use it everywhere. Or something similarly elegant
How do I do that?