optionally colorized date extensions (due, threshold and again)
This commit is contained in:
BIN
.todo.sh.swp
Normal file
BIN
.todo.sh.swp
Normal file
Binary file not shown.
4
todo.cfg
4
todo.cfg
@@ -67,6 +67,10 @@ export REPORT_FILE="$TODO_DIR/report.txt"
|
|||||||
# export COLOR_PROJECT=$RED
|
# export COLOR_PROJECT=$RED
|
||||||
# export COLOR_CONTEXT=$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 ===
|
# === BEHAVIOR ===
|
||||||
|
|
||||||
## customize list output
|
## customize list output
|
||||||
|
|||||||
10
todo.sh
10
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_C=$LIGHT_BLUE # color for C priority
|
||||||
export PRI_X=$WHITE # color unless explicitly defined
|
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_PROJECT=$NONE
|
||||||
export COLOR_CONTEXT=$NONE
|
export COLOR_CONTEXT=$NONE
|
||||||
|
export COLOR_DATEEXT=$NONE
|
||||||
|
|
||||||
# Default highlight colors.
|
# Default highlight colors.
|
||||||
export COLOR_DONE=$LIGHT_GREY # color for done (but not yet archived) tasks
|
export COLOR_DONE=$LIGHT_GREY # color for done (but not yet archived) tasks
|
||||||
@@ -964,6 +965,9 @@ _format()
|
|||||||
ctx_beg = highlight("COLOR_CONTEXT")
|
ctx_beg = highlight("COLOR_CONTEXT")
|
||||||
ctx_end = (ctx_beg ? (highlight("DEFAULT") clr) : "")
|
ctx_end = (ctx_beg ? (highlight("DEFAULT") clr) : "")
|
||||||
|
|
||||||
|
dtx_beg = highlight("COLOR_DATEEXT")
|
||||||
|
dtx_end = (dtx_beg ? (highlight("DEFAULT") clr) : "")
|
||||||
|
|
||||||
gsub(/[ \t][ \t]*/, "\n&\n")
|
gsub(/[ \t][ \t]*/, "\n&\n")
|
||||||
len = split($0, words, /\n/)
|
len = split($0, words, /\n/)
|
||||||
|
|
||||||
@@ -973,7 +977,9 @@ _format()
|
|||||||
printf "%s", prj_beg words[i] prj_end
|
printf "%s", prj_beg words[i] prj_end
|
||||||
} else if (words[i] ~ /^[@].*[A-Za-z0-9_]$/) {
|
} else if (words[i] ~ /^[@].*[A-Za-z0-9_]$/) {
|
||||||
printf "%s", ctx_beg words[i] ctx_end
|
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]
|
printf "%s", words[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user