4

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
  • 3,337
  • 11
  • 42
  • 51

2 Answers2

5

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
  • 185
  • 1
  • 3
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
  • 22,638
  • 2
  • 45
  • 58
  • 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 Nov 05 '13 at 00:27
  • 1
    @david My extension requires GNU awk (`gawk`), because it uses its extensions. That's your problem. – Ingo Karkat Nov 05 '13 at 07:25