mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Feature #481 - color should follow rc order
- Added feature #481, allowing for user control of the color rule order of precedence via the 'rule.precedence.color' configuration variable. - Color rules now obey the rc.search.case.sensitive configuration option. - The color.keyword.XXX color rule now applies to annotations too.
This commit is contained in:
parent
c27097e286
commit
4cd528661a
11 changed files with 442 additions and 276 deletions
274
src/Config.cpp
274
src/Config.cpp
|
@ -59,171 +59,170 @@ std::string Config::defaults =
|
|||
"\n"
|
||||
"# Files\n"
|
||||
"data.location=~/.task\n"
|
||||
"locking=on # Use file-level locking\n"
|
||||
"locking=on # Use file-level locking\n"
|
||||
"\n"
|
||||
"# Terminal\n"
|
||||
"curses=on # Use ncurses library to determine terminal width\n"
|
||||
"defaultwidth=80 # Without ncurses, assumed width\n"
|
||||
"#editor=vi # Preferred text editor\n"
|
||||
"curses=on # Use ncurses library to determine terminal width\n"
|
||||
"defaultwidth=80 # Without ncurses, assumed width\n"
|
||||
"#editor=vi # Preferred text editor\n"
|
||||
"\n"
|
||||
"# Miscellaneous\n"
|
||||
"verbose=yes # Provide extra feedback\n"
|
||||
"confirmation=yes # Confirmation on delete, big changes\n"
|
||||
"echo.command=yes # Details on command just run\n"
|
||||
"annotations=full # Level of verbosity for annotations: full, sparse or none\n"
|
||||
"next=2 # How many tasks per project in next report\n"
|
||||
"bulk=2 # > 2 tasks considered 'a lot', for confirmation\n"
|
||||
"nag=You have higher priority tasks. # Nag message to keep you honest\n" // TODO
|
||||
"search.case.sensitive=yes # Setting to no allows case insensitive searches\n"
|
||||
"active.indicator=* # What to show as an active task indicator\n"
|
||||
"tag.indicator=+ # What to show as a tag indicator\n"
|
||||
"recurrence.indicator=R # What to show as a task recurrence indicator\n"
|
||||
"recurrence.limit=1 # Number of future recurring pending tasks\n"
|
||||
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
|
||||
"verbose=yes # Provide extra feedback\n"
|
||||
"confirmation=yes # Confirmation on delete, big changes\n"
|
||||
"echo.command=yes # Details on command just run\n"
|
||||
"annotations=full # Level of verbosity for annotations: full, sparse or none\n"
|
||||
"next=2 # How many tasks per project in next report\n"
|
||||
"bulk=2 # > 2 tasks considered 'a lot', for confirmation\n"
|
||||
"nag=You have higher priority tasks. # Nag message to keep you honest\n" // TODO
|
||||
"search.case.sensitive=yes # Setting to no allows case insensitive searches\n"
|
||||
"active.indicator=* # What to show as an active task indicator\n"
|
||||
"tag.indicator=+ # What to show as a tag indicator\n"
|
||||
"recurrence.indicator=R # What to show as a task recurrence indicator\n"
|
||||
"recurrence.limit=1 # Number of future recurring pending tasks\n"
|
||||
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
|
||||
"\n"
|
||||
"# Dates\n"
|
||||
"dateformat=m/d/Y # Preferred input and display date format\n"
|
||||
"dateformat.holiday=YMD # Preferred input date format for holidays\n"
|
||||
"dateformat.report=m/d/Y # Preferred display date format for reports\n"
|
||||
"dateformat.annotation=m/d/Y # Preferred display date format for reports\n"
|
||||
"weekstart=Sunday # Sunday or Monday only\n"
|
||||
"displayweeknumber=yes # Show week numbers on calendar\n"
|
||||
"due=7 # Task is considered due in 7 days\n"
|
||||
"dateformat=m/d/Y # Preferred input and display date format\n"
|
||||
"dateformat.holiday=YMD # Preferred input date format for holidays\n"
|
||||
"dateformat.report=m/d/Y # Preferred display date format for reports\n"
|
||||
"dateformat.annotation=m/d/Y # Preferred display date format for reports\n"
|
||||
"weekstart=Sunday # Sunday or Monday only\n"
|
||||
"displayweeknumber=yes # Show week numbers on calendar\n"
|
||||
"due=7 # Task is considered due in 7 days\n"
|
||||
"\n"
|
||||
"# Calendar controls\n"
|
||||
"calendar.legend=yes # Display the legend on calendar\n"
|
||||
"calendar.details=sparse # Calendar shows information for tasks w/due dates: full, sparse or none\n"
|
||||
"calendar.details.report=list # Report to use when showing task information in cal\n"
|
||||
"calendar.holidays=none # Show public holidays on calendar:full, sparse or none\n"
|
||||
"#monthsperline=3 # Number of calendar months on a line\n"
|
||||
"calendar.legend=yes # Display the legend on calendar\n"
|
||||
"calendar.details=sparse # Calendar shows information for tasks w/due dates: full, sparse or none\n"
|
||||
"calendar.details.report=list # Report to use when showing task information in cal\n"
|
||||
"calendar.holidays=none # Show public holidays on calendar:full, sparse or none\n"
|
||||
"#monthsperline=3 # Number of calendar months on a line\n"
|
||||
"\n"
|
||||
"# Journal controls\n"
|
||||
"journal.time=no # Record start/stop commands as annotation\n"
|
||||
"journal.time.start.annotation=Started task # Annotation description for the start journal entry\n"
|
||||
"journal.time.stop.annotation=Stopped task # Annotation description for the stop journal entry\n"
|
||||
"journal.time=no # Record start/stop commands as annotation\n"
|
||||
"journal.time.start.annotation=Started task # Annotation description for the start journal entry\n"
|
||||
"journal.time.stop.annotation=Stopped task # Annotation description for the stop journal entry\n"
|
||||
"\n"
|
||||
"# Urgency Coefficients\n"
|
||||
"urgency.next.coefficient=10.0 # Urgency coefficients for 'next' special tag\n"
|
||||
"urgency.blocking.coefficient=9.0 # Urgency coefficients for blocking tasks\n"
|
||||
"urgency.blocked.coefficient=8.0 # Urgency coefficients for blocked tasks\n"
|
||||
"urgency.due.coefficient=7.0 # Urgency coefficients for due dates\n"
|
||||
"urgency.priority.coefficient=6.0 # Urgency coefficients for priorities\n"
|
||||
"urgency.waiting.coefficient=5.0 # Urgency coefficients for waiting status\n"
|
||||
"urgency.active.coefficient=4.0 # Urgency coefficients for active tasks\n"
|
||||
"urgency.project.coefficient=3.0 # Urgency coefficients for projects\n"
|
||||
"urgency.tags.coefficient=2.0 # Urgency coefficients for tags\n"
|
||||
"urgency.annotations.coefficient=1.0 # Urgency coefficients for annotations\n"
|
||||
"urgency.next.coefficient=10.0 # Urgency coefficients for 'next' special tag\n"
|
||||
"urgency.blocking.coefficient=9.0 # Urgency coefficients for blocking tasks\n"
|
||||
"urgency.blocked.coefficient=8.0 # Urgency coefficients for blocked tasks\n"
|
||||
"urgency.due.coefficient=7.0 # Urgency coefficients for due dates\n"
|
||||
"urgency.priority.coefficient=6.0 # Urgency coefficients for priorities\n"
|
||||
"urgency.waiting.coefficient=5.0 # Urgency coefficients for waiting status\n"
|
||||
"urgency.active.coefficient=4.0 # Urgency coefficients for active tasks\n"
|
||||
"urgency.project.coefficient=3.0 # Urgency coefficients for projects\n"
|
||||
"urgency.tags.coefficient=2.0 # Urgency coefficients for tags\n"
|
||||
"urgency.annotations.coefficient=1.0 # Urgency coefficients for annotations\n"
|
||||
"\n"
|
||||
"#urgency.user.project.foo.coefficient=5.0 # Urgency coefficients for 'foo' project\n"
|
||||
"#urgency.user.tag.foo.coefficient=5.0 # Urgency coefficients for 'foo' tag\n"
|
||||
"#urgency.user.project.foo.coefficient=5.0 # Urgency coefficients for 'foo' project\n"
|
||||
"#urgency.user.tag.foo.coefficient=5.0 # Urgency coefficients for 'foo' tag\n"
|
||||
"\n"
|
||||
"# Color controls.\n"
|
||||
"color=on # Enable color\n"
|
||||
"color=on # Enable color\n"
|
||||
#ifdef LINUX
|
||||
"color.header=color3 # Color of header messages\n"
|
||||
"color.footnote=color3 # Color of footnote messages\n"
|
||||
"color.debug=color3 # Color of diagnostic output\n"
|
||||
"color.header=color3 # Color of header messages\n"
|
||||
"color.footnote=color3 # Color of footnote messages\n"
|
||||
"color.debug=color3 # Color of diagnostic output\n"
|
||||
"color.alternate=on color233 # Alternate color for line coloring\n"
|
||||
"\n"
|
||||
"color.summary.bar=on rgb141 # Color of summary report progress bar\n"
|
||||
"color.summary.background=on color0 # Color of summary report background\n"
|
||||
"color.summary.bar=on rgb141 # Color of summary report progress bar\n"
|
||||
"color.summary.background=on color0 # Color of summary report background\n"
|
||||
"\n"
|
||||
"color.history.add=color0 on rgb500 # Color of added tasks in ghistory report\n"
|
||||
"color.history.done=color0 on rgb050 # Color of completed tasks in ghistory report\n"
|
||||
"color.history.delete=color0 on rgb550 # Color of deleted tasks in ghistory report\n"
|
||||
"color.history.add=color0 on rgb500 # Color of added tasks in ghistory report\n"
|
||||
"color.history.done=color0 on rgb050 # Color of completed tasks in ghistory report\n"
|
||||
"color.history.delete=color0 on rgb550 # Color of deleted tasks in ghistory report\n"
|
||||
"\n"
|
||||
"color.undo.before=color1 # Color of values before a change\n"
|
||||
"color.undo.after=color2 # Color of values after a change\n"
|
||||
"color.undo.before=color1 # Color of values before a change\n"
|
||||
"color.undo.after=color2 # Color of values after a change\n"
|
||||
"\n"
|
||||
"color.calendar.today=color15 on rgb013 # Color of today in calendar\n"
|
||||
"color.calendar.due=color0 on color1 # Color of days with due tasks in calendar\n"
|
||||
"color.calendar.due.today=color15 on color1 # Color of today with due tasks in calendar\n"
|
||||
"color.calendar.overdue=color0 on color9 # Color of days with overdue tasks in calendar\n"
|
||||
"color.calendar.weekend=color235 # Color of weekend days in calendar\n"
|
||||
"color.calendar.holiday=color0 on color11 # Color of public holidays in calendar\n"
|
||||
"color.calendar.weeknumber=rgb013 # Color of the weeknumbers in calendar\n"
|
||||
"color.calendar.due=color0 on color1 # Color of days with due tasks in calendar\n"
|
||||
"color.calendar.due.today=color15 on color1 # Color of today with due tasks in calendar\n"
|
||||
"color.calendar.overdue=color0 on color9 # Color of days with overdue tasks in calendar\n"
|
||||
"color.calendar.weekend=color235 # Color of weekend days in calendar\n"
|
||||
"color.calendar.holiday=color0 on color11 # Color of public holidays in calendar\n"
|
||||
"color.calendar.weeknumber=rgb013 # Color of the weeknumbers in calendar\n"
|
||||
"\n"
|
||||
"# The following rules are presented in their order of precedence.\n"
|
||||
"# The higher the color rule is up this list, the higher precedence\n"
|
||||
"# it has in determining the color for the task. Precedence is shown\n"
|
||||
"# in brackets [1]\n"
|
||||
"color.recurring=rgb013 # [1] Color of recur.any: tasks\n"
|
||||
"color.overdue=color9 # [2] Color of overdue tasks\n"
|
||||
"color.due.today=rgb400 # [3] Color of tasks due today\n"
|
||||
"color.due=color1 # [4] Color of due tasks\n"
|
||||
"#color.keyword.car=on blue # [5] Color of description.contains:car tasks\n"
|
||||
"#color.project.garden=on green # [6] Color of project:garden tasks\n"
|
||||
"#color.tag.bug=yellow # [7] Color of +bug tasks\n"
|
||||
"color.active=rgb555 on rgb410 # [8] Color of active tasks\n"
|
||||
"color.pri.none= # [9] Color of priority: tasks\n"
|
||||
"color.pri.H=rgb255 # [9] Color of priority:H tasks\n"
|
||||
"color.pri.M=rgb250 # [9] Color of priority:M tasks\n"
|
||||
"color.pri.L=rgb245 # [9] Color of priority:L tasks\n"
|
||||
"color.tagged=rgb031 # [10] Color of tagged tasks\n"
|
||||
"color.blocked=black on white # [11] Color of blocked tasks\n"
|
||||
"color.alternate=on color233 # [12] Alternate color for line coloring\n"
|
||||
"# Here are the color rules.\n"
|
||||
"color.recurring=rgb013 # Color of recur.any: tasks\n"
|
||||
"color.overdue=color9 # Color of overdue tasks\n"
|
||||
"color.due.today=rgb400 # Color of tasks due today\n"
|
||||
"color.due=color1 # Color of due tasks\n"
|
||||
"#color.keyword.car=on blue # Color of description.contains:car tasks\n"
|
||||
"#color.project.garden=on green # Color of project:garden tasks\n"
|
||||
"#color.tag.bug=yellow # Color of +bug tasks\n"
|
||||
"color.active=rgb555 on rgb410 # Color of active tasks\n"
|
||||
"color.pri.none= # Color of priority: tasks\n"
|
||||
"color.pri.H=rgb255 # Color of priority:H tasks\n"
|
||||
"color.pri.M=rgb250 # Color of priority:M tasks\n"
|
||||
"color.pri.L=rgb245 # Color of priority:L tasks\n"
|
||||
"color.tagged=rgb031 # Color of tagged tasks\n"
|
||||
"color.blocked=black on white # Color of blocked tasks\n"
|
||||
#else
|
||||
"color.header=yellow # Color of header messages\n"
|
||||
"color.footnote=yellow # Color of footnote messages\n"
|
||||
"color.debug=yellow # Color of diagnostic output\n"
|
||||
"color.header=yellow # Color of header messages\n"
|
||||
"color.footnote=yellow # Color of footnote messages\n"
|
||||
"color.debug=yellow # Color of diagnostic output\n"
|
||||
"color.alternate= # Alternate color for line coloring\n"
|
||||
"\n"
|
||||
"color.summary.bar=on green # Color of summary report progress bar\n"
|
||||
"color.summary.background=on black # Color of summary report background\n"
|
||||
"color.summary.bar=on green # Color of summary report progress bar\n"
|
||||
"color.summary.background=on black # Color of summary report background\n"
|
||||
"\n"
|
||||
"color.history.add=black on red # Color of added tasks in ghistory report\n"
|
||||
"color.history.done=black on green # Color of completed tasks in ghistory report\n"
|
||||
"color.history.delete=black on yellow # Color of deleted tasks in ghistory report\n"
|
||||
"color.history.add=black on red # Color of added tasks in ghistory report\n"
|
||||
"color.history.done=black on green # Color of completed tasks in ghistory report\n"
|
||||
"color.history.delete=black on yellow # Color of deleted tasks in ghistory report\n"
|
||||
"\n"
|
||||
"color.undo.before=red # Color of values before a change\n"
|
||||
"color.undo.after=green # Color of values after a change\n"
|
||||
"color.undo.before=red # Color of values before a change\n"
|
||||
"color.undo.after=green # Color of values after a change\n"
|
||||
"\n"
|
||||
"color.calendar.today=bold white on bright blue # Color of today in calendar\n"
|
||||
"color.calendar.due=white on red # Color of days with due tasks in calendar\n"
|
||||
"color.calendar.due.today=bold white on red # Color of today with due tasks in calendar\n"
|
||||
"color.calendar.overdue=black on bright red # Color of days with overdue tasks in calendar\n"
|
||||
"color.calendar.weekend=white on bright black # Color of weekend days in calendar\n"
|
||||
"color.calendar.holiday=black on bright yellow # Color of public holidays in calendar\n"
|
||||
"color.calendar.weeknumber=bold blue # Color of the weeknumbers in calendar\n"
|
||||
"color.calendar.due=white on red # Color of days with due tasks in calendar\n"
|
||||
"color.calendar.due.today=bold white on red # Color of today with due tasks in calendar\n"
|
||||
"color.calendar.overdue=black on bright red # Color of days with overdue tasks in calendar\n"
|
||||
"color.calendar.weekend=white on bright black # Color of weekend days in calendar\n"
|
||||
"color.calendar.holiday=black on bright yellow # Color of public holidays in calendar\n"
|
||||
"color.calendar.weeknumber=bold blue # Color of the weeknumbers in calendar\n"
|
||||
"\n"
|
||||
"# The following rules are presented in their order of precedence.\n"
|
||||
"# The higher the color rule is up this list, the higher precedence\n"
|
||||
"# it has in determining the color for the task. Precedence is shown\n"
|
||||
"# in brackets [1]\n"
|
||||
"color.recurring=magenta # [1] Color of recur.any: tasks\n"
|
||||
"color.overdue=bold red # [2] Color of overdue tasks\n"
|
||||
"color.due.today=red # [3] Color of tasks due today\n"
|
||||
"color.due=red # [4] Color of due tasks\n"
|
||||
"#color.keyword.car=on blue # [5] Color of description.contains:car tasks\n"
|
||||
"#color.project.garden=on green # [6] Color of project:garden tasks\n"
|
||||
"#color.tag.bug=yellow # [7] Color of +bug tasks\n"
|
||||
"color.active=black on bright green # [8] Color of active tasks\n"
|
||||
"color.pri.none= # [9] Color of priority: tasks\n"
|
||||
"color.pri.H=bold white # [9] Color of priority:H tasks\n"
|
||||
"color.pri.M=white # [9] Color of priority:M tasks\n"
|
||||
"color.pri.L= # [9] Color of priority:L tasks\n"
|
||||
"color.tagged=green # [10] Color of tagged tasks\n"
|
||||
"color.blocked=black on white # [11] Color of blocked tasks\n"
|
||||
"color.alternate= # [12] Alternate color for line coloring\n"
|
||||
"# Here are the color rules.\n"
|
||||
"color.recurring=magenta # Color of recur.any: tasks\n"
|
||||
"color.overdue=bold red # Color of overdue tasks\n"
|
||||
"color.due.today=red # Color of tasks due today\n"
|
||||
"color.due=red # Color of due tasks\n"
|
||||
"#color.keyword.car=on blue # Color of description.contains:car tasks\n"
|
||||
"#color.project.garden=on green # Color of project:garden tasks\n"
|
||||
"#color.tag.bug=yellow # Color of +bug tasks\n"
|
||||
"color.active=black on bright green # Color of active tasks\n"
|
||||
"color.pri.none= # Color of priority: tasks\n"
|
||||
"color.pri.H=bold white # Color of priority:H tasks\n"
|
||||
"color.pri.M=white # Color of priority:M tasks\n"
|
||||
"color.pri.L= # Color of priority:L tasks\n"
|
||||
"color.tagged=green # Color of tagged tasks\n"
|
||||
"color.blocked=black on white # Color of blocked tasks\n"
|
||||
#endif
|
||||
"\n"
|
||||
"# Here is the rule precedence order, highest to lowest.\n"
|
||||
"# Note that these are just the color rule names, without the leading 'color.'\n"
|
||||
"# and any trailing '.value'.\n"
|
||||
"rule.precedence.color=due.today,active,blocked,overdue,due,keyword,project,tag,recurring,pri,tagged\n"
|
||||
"\n"
|
||||
"# Shadow file support\n"
|
||||
"#shadow.file=/tmp/shadow.txt # Location of shadow file\n"
|
||||
"#shadow.command=list # Task command for shadow file\n"
|
||||
"#shadow.notify=on # Footnote when updated\n"
|
||||
"#shadow.file=/tmp/shadow.txt # Location of shadow file\n"
|
||||
"#shadow.command=list # Task command for shadow file\n"
|
||||
"#shadow.notify=on # Footnote when updated\n"
|
||||
"\n"
|
||||
"#default.project=foo # Default project for 'add' command\n"
|
||||
"#default.priority=M # Default priority for 'add' command\n"
|
||||
"default.command=list # When no arguments are specified\n"
|
||||
"#default.project=foo # Default project for 'add' command\n"
|
||||
"#default.priority=M # Default priority for 'add' command\n"
|
||||
"default.command=list # When no arguments are specified\n"
|
||||
"\n"
|
||||
"_forcecolor=no # Forces color to be on, even for non TTY output\n"
|
||||
"blanklines=true # Use more whitespace in output\n"
|
||||
"complete.all.projects=no # Include old project names in '_projects' command\n"
|
||||
"complete.all.tags=no # Include old tag names in '_ags' command\n"
|
||||
"list.all.projects=no # Include old project names in 'projects' command\n"
|
||||
"list.all.tags=no # Include old tag names in 'tags' command\n"
|
||||
"debug=no # Display diagnostics\n"
|
||||
"hooks=off # Hook system master switch\n"
|
||||
"fontunderline=yes # Uses underlines rather than -------\n"
|
||||
"shell.prompt=task> # Prompt used by the shell command\n"
|
||||
"_forcecolor=no # Forces color to be on, even for non TTY output\n"
|
||||
"blanklines=true # Use more whitespace in output\n"
|
||||
"complete.all.projects=no # Include old project names in '_projects' command\n"
|
||||
"complete.all.tags=no # Include old tag names in '_ags' command\n"
|
||||
"list.all.projects=no # Include old project names in 'projects' command\n"
|
||||
"list.all.tags=no # Include old tag names in 'tags' command\n"
|
||||
"debug=no # Display diagnostics\n"
|
||||
"hooks=off # Hook system master switch\n"
|
||||
"fontunderline=yes # Uses underlines rather than -------\n"
|
||||
"shell.prompt=task> # Prompt used by the shell command\n"
|
||||
"\n"
|
||||
"# Import heuristics - alternate names for fields (comma-separated list of names)\n"
|
||||
"#import.synonym.bg=?\n"
|
||||
|
@ -242,14 +241,14 @@ std::string Config::defaults =
|
|||
"#import.synonym.uuid=?\n"
|
||||
"\n"
|
||||
"# Export Controls\n"
|
||||
"export.ical.class=PRIVATE # Could be PUBLIC, PRIVATE or CONFIDENTIAL\n"
|
||||
"export.ical.class=PRIVATE # Could be PUBLIC, PRIVATE or CONFIDENTIAL\n"
|
||||
"\n"
|
||||
"# Aliases - alternate names for commands\n"
|
||||
"alias.rm=delete # Alias for the delete command\n"
|
||||
"alias.history=history.monthly # Prefer monthly over annual history reports\n"
|
||||
"alias.ghistory=ghistory.monthly # Prefer monthly graphical over annual history reports\n"
|
||||
"alias.export=export.yaml # Prefer YAML over CSV or iCal export\n"
|
||||
"alias.export.vcalendar=export.ical # They are the same\n"
|
||||
"alias.rm=delete # Alias for the delete command\n"
|
||||
"alias.history=history.monthly # Prefer monthly over annual history reports\n"
|
||||
"alias.ghistory=ghistory.monthly # Prefer monthly graphical over annual history reports\n"
|
||||
"alias.export=export.yaml # Prefer YAML over CSV or iCal export\n"
|
||||
"alias.export.vcalendar=export.ical # They are the same\n"
|
||||
"\n"
|
||||
"# Fields: id, uuid, project, priority, priority_long, entry, start, end, due\n"
|
||||
"# countdown, countdown_compact, age, age_compact, active, tags,\n"
|
||||
|
@ -395,6 +394,7 @@ std::string Config::defaults =
|
|||
//
|
||||
// In all real use cases, Config::load is called.
|
||||
Config::Config ()
|
||||
: original_file ()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue