From f81f7ce010a4b51df66cc2f9e91d5b3418f855c4 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Tue, 18 Oct 2016 15:58:07 +0300 Subject: [PATCH] Add Option to disable python support lookup. --- doc/todo.txt | 8 ++++++++ syntax/todo.vim | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/todo.txt b/doc/todo.txt index f13c0da..9ae55bb 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -56,5 +56,13 @@ date of creation: > r - replace existing date (default) n - do nothing + *'g:todo_existing_date'* +Specify if the plugin should load the python module. Useful if you use Neovim +for example or if perhaps you just don't have/want python for vim: > + let g:todo_load_python = 1 +< + 1 - Load (default) + 0 - Don't load + =============================================================================== vim:ft=help:et:ts=2:sw=2:sts=2:norl diff --git a/syntax/todo.vim b/syntax/todo.vim index 5096019..40929e3 100644 --- a/syntax/todo.vim +++ b/syntax/todo.vim @@ -50,16 +50,18 @@ highlight default link TodoDate PreProc highlight default link TodoProject Special highlight default link TodoContext Special -if has('python') - let b:curdir = expand(':p:h') - let s:script_dir = b:curdir . "/python/" - execute "pyfile " . s:script_dir. "todo.py" -elseif has('python3') +if g:todo_load_python + if has('python') + let b:curdir = expand(':p:h') + let s:script_dir = b:curdir . "/python/" + execute "pyfile " . s:script_dir. "todo.py" + elseif has('python3') let b:curdir = expand(':p:h') let s:script_dir = b:curdir . "/python/" execute "py3file " . s:script_dir. "todo.py" -else - echom "Your version of vim has no python support. Overdue dates won't be highlighted" + else + echom "Your version of vim has no python support. Overdue dates won't be highlighted" + endif endif let b:current_syntax = "todo"