[Remind-Fans] Remind tip: Utility formatting functions

Tim Chase remind at tim.thechases.com
Thu Jan 21 09:43:43 EST 2021


Just thought I'd share some of my recent remind(1) hacks in case they
interest anybody else:

1) I colorize things conditionally based on whether I've passed a
variable on the command-line, so in my helpers.rem I have 

  IF defined("COLOR")
    FSET c(color) color
  ELSE
    FSET c(color) ""
  ENDIF

I then wrap color-changes in the c() function

  c(BrRed) + "some text" + c(Nrm)

so I can then invoke remind as

  remind -iCOLOR=1 …

for colorized text or without the "-iCOLOR=1" for straight non-ANSI
text


2) I've created some functions to both colorize and make it easier to
find things:

  FSET url(s) \
    c(Blu) \
    + s \
    + c(Nrm)

  FSET zoom(desc, meetingid, pwd) \
    "%\"" + desc + "%\"" \
    + c(Gry) \
    + " Zoom " \
    + dosubst("%2", $T, trigtime()) \
    + "%_    " \
    + c(BrRed) \
    + meetingid \
    + c(Gry) + "/" \
    + c(BrRed) + pwd \
    + c(Nrm)

I'm stuck with a lot of Zoom calls these days, and it's nice to have
them show up as normal, but have the credentials highlight to make
them easy to find.  Also, but having fixed text like "url(" or
"zoom(" in my remind files, it makes it easier to search for them if
I need to update them.

Anyways, just thought I'd share in case anybody else found these
ideas useful.

-tim






More information about the Remind-fans mailing list