Use python3 if available
This commit incorporates [fievel's work](0863e1434e) to use python3 if possible.
I have not personally test vim+python3 but overdue dates still works with
python2.
This commit is contained in:
@@ -24,6 +24,7 @@ def _year_regex_before(year):
|
||||
|
||||
year_regex += ')'
|
||||
return '-'.join((year_regex, r'\d{2}', r'\d{2}'))
|
||||
|
||||
def _month_regex_before(year, month):
|
||||
if month == '01':
|
||||
return None
|
||||
@@ -63,6 +64,7 @@ def _day_regex_before(year, month, day):
|
||||
|
||||
|
||||
|
||||
|
||||
def regex_date_before(given_date):
|
||||
year, month, day = given_date.isoformat().split('-')
|
||||
|
||||
|
||||
@@ -53,10 +53,10 @@ highlight default link TodoContext Special
|
||||
|
||||
let b:curdir = expand('<sfile>:p:h')
|
||||
let s:script_dir = b:curdir . "/python/"
|
||||
if has('python')
|
||||
execute "pyfile " . s:script_dir. "todo.py"
|
||||
elseif has('python3')
|
||||
if has('python3')
|
||||
execute "py3file " . s:script_dir. "todo.py"
|
||||
elseif has('python')
|
||||
execute "pyfile " . s:script_dir. "todo.py"
|
||||
endif
|
||||
|
||||
let b:current_syntax = "todo"
|
||||
|
||||
Reference in New Issue
Block a user