How to highlight contexts/projects in todo.txt?

3

Does anyone use the todo.txt command line interface (todotxt.com)? I would like it so that when I type todo ls to show my tasks, it will highlight the +contexts and @projects with colors. How do I do that?

Eddy

Posted 2011-11-26T22:49:12.040

Reputation: 2 897

Answers

3

The original color highlighting filter was posted on the todo.txt mailing list. And this Gist contains the version I once fixed for Gina, the initiator of todo.txt.

I have also written an extended version, published as part of my todo.txt-cli-ex extension.

Any of these must be installed in todo.cfg via

export TODOTXT_FINAL_FILTER=/path/to/colorSymbols

Ingo Karkat

Posted 2011-11-26T22:49:12.040

Reputation: 19 513

your extension seems not to work with the current todo.sh anymore: {awk: calling undefined function gensub input record number 1, file source line number 62} – david – 2013-11-05T00:27:33.907

1@david My extension requires GNU awk (gawk), because it uses its extensions. That's your problem. – Ingo Karkat – 2013-11-05T07:25:14.703

3

I am not sure when this feature was introduced, but with the current version of todo.sh, you can enable the coloring in your config file (normally todo.cfg) by setting the variables COLOR_PROJECT and COLOR_CONTEXT to some value:

export COLOR_PROJECT=$LIGHT_BLUE
export COLOR_CONTEXT=$GREEN

(for example)

If this is enough for your purpose, you don't have to install an external color filter.

Edgar

Posted 2011-11-26T22:49:12.040

Reputation: 130