plugin: Prefer python3 over python2 by default

This commit is contained in:
Tomas Babej 2017-03-16 12:26:39 +01:00
parent 40b4f2c28a
commit cf3789f074
2 changed files with 12 additions and 5 deletions

View file

@ -674,6 +674,13 @@ constructs.
*taskwiki_disable*
Setting any non-empty value for this variable will disable taskwiki.
*taskwiki_use_python2*
Setting this variable to non-empty value (such as "yes") will force
taskwiki to use python2.
Example:
let g:taskwiki_use_python2="yes"
=============================================================================
9. TROUBLESHOOTING *taskwiki-trouble*

View file

@ -4,16 +4,16 @@ if version < 704
finish
endif
" Check presence of the python support
if has("nvim")
" Python version detection.
elseif has("nvim")
let g:taskwiki_py='py3 '
let g:taskwiki_pyfile='py3file '
elseif has("python3") && ! exists("g:taskwiki_use_python2")
let g:taskwiki_py='py3 '
let g:taskwiki_pyfile='py3file '
elseif has("python")
let g:taskwiki_py='py '
let g:taskwiki_pyfile='pyfile '
elseif has("python3")
let g:taskwiki_py='py3 '
let g:taskwiki_pyfile='py3file '
else
echoerr "Taskwiki requires Vim compiled with the Python support."
finish