diff --git a/.todo.sh.swp b/.todo.sh.swp new file mode 100644 index 0000000..b460250 Binary files /dev/null and b/.todo.sh.swp differ diff --git a/todo.cfg b/todo.cfg index 6c6f867..f99082c 100644 --- a/todo.cfg +++ b/todo.cfg @@ -67,6 +67,10 @@ export REPORT_FILE="$TODO_DIR/report.txt" # export COLOR_PROJECT=$RED # export COLOR_CONTEXT=$RED +# ... and for date extensions (due:yyyy-mm-dd, t:yyyy-mm-dd and again:X) +# +# export COLOR_DATEEXT=$LIGHT_BLUE + # === BEHAVIOR === ## customize list output diff --git a/todo.sh b/todo.sh index df56640..7519a6e 100755 --- a/todo.sh +++ b/todo.sh @@ -644,9 +644,10 @@ export PRI_B=$GREEN # color for B priority export PRI_C=$LIGHT_BLUE # color for C priority export PRI_X=$WHITE # color unless explicitly defined -# Default project and context colors. +# Default project, context and dateext colors. export COLOR_PROJECT=$NONE export COLOR_CONTEXT=$NONE +export COLOR_DATEEXT=$NONE # Default highlight colors. export COLOR_DONE=$LIGHT_GREY # color for done (but not yet archived) tasks @@ -964,6 +965,9 @@ _format() ctx_beg = highlight("COLOR_CONTEXT") ctx_end = (ctx_beg ? (highlight("DEFAULT") clr) : "") + dtx_beg = highlight("COLOR_DATEEXT") + dtx_end = (dtx_beg ? (highlight("DEFAULT") clr) : "") + gsub(/[ \t][ \t]*/, "\n&\n") len = split($0, words, /\n/) @@ -973,7 +977,9 @@ _format() printf "%s", prj_beg words[i] prj_end } else if (words[i] ~ /^[@].*[A-Za-z0-9_]$/) { printf "%s", ctx_beg words[i] ctx_end - } else { + } else if (words[i] ~ /^(due|t|again):/) { + printf "%s", dtx_beg words[i] dtx_end + } else { printf "%s", words[i] } }