diff --git a/doc/taskwiki.txt b/doc/taskwiki.txt index 63f914d..34a74e5 100644 --- a/doc/taskwiki.txt +++ b/doc/taskwiki.txt @@ -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* diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index ef1489f..9ddb898 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -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