mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-11 03:13:46 -05:00
Correct .gitmodules file
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
|||||||
[submodule "python/dateregex"]
|
[submodule "syntax/python/dateregex"]
|
||||||
path = syntax/python/dateregex
|
path = syntax/python/dateregex
|
||||||
url = https://github.com/victal/dateregex.git
|
url = https://github.com/victal/dateregex.git
|
||||||
|
|||||||
1
syntax/python/dateregex
Submodule
1
syntax/python/dateregex
Submodule
Submodule syntax/python/dateregex added at 7db2e6ca01
25
syntax/python/todo.py
Normal file
25
syntax/python/todo.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env python2
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import vim
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
|
dateregex_dir = os.path.join(vim.eval('s:script_dir'), 'dateregex')
|
||||||
|
if os.path.isdir(dateregex_dir):
|
||||||
|
sys.path.insert(0, dateregex_dir)
|
||||||
|
|
||||||
|
def add_due_date_syntax_highlight():
|
||||||
|
try:
|
||||||
|
from dateregex import regex_date_before
|
||||||
|
except ImportError:
|
||||||
|
print("dateregex module not found. Overdue dates won't be highlighted")
|
||||||
|
return
|
||||||
|
|
||||||
|
regex = regex_date_before(date.today())
|
||||||
|
regex = r'(^|<)due:%s(>|$)' % regex
|
||||||
|
|
||||||
|
vim.command("syntax match OverDueDate '\\v%s'" % regex)
|
||||||
|
vim.command("highlight default link OverDueDate Error")
|
||||||
|
|
||||||
|
add_due_date_syntax_highlight()
|
||||||
Reference in New Issue
Block a user