Open rohieb opened 7 years ago
As khal is already a shortcut, by default to khal list
, I believe adding any more shortcuts would make usage and implementation even more complicated. I would suggest instead alias k to khal list.
But adding some more shortcuts might be a good idea, but note, that we do support some of them the ones taskwarrior uses already, it's just not documented anywhere, currently supported:
Aliasing k = khal list
is indeed a solution. Then we have only the extended date syntax left. I would find especially useful:
next month
, or in general, mar
, march
, dec 2017
, and 2017-12
(each resolving to the 1st of a month respectively), useful for khal calendar
23rd
, 23.
,12th
, 12.
etc. for the next day of month with that numberI'm going to rename the issue to 'Support for date shortcuts' so it's clearer what's the unresolved part is about.
I have some ideas for other aliases, shortcuts, syntax date extensions:
[this] {day,week,month,year}
as a date range, (this day
and day
might be left out as we already have today
)next {day,week,month,year}
as date rangeuntil XXX
where XXX
is a datetime, this could by syntactic sugar for today XXX
XXX +YZ
where XXX
can be any date range, +YZ
is ment to be a relative time description with Y
being a number (positive integral) and Z
a letter from hdwmy
, which should be interpreted as one of the units "hour", "day", "week", "month", "year". The result should be a date range starting at XXX
and ending Y
units Z
later. (if XXX
is left out it could default to now
)date(time) [NX] +
already works, where N is a number and X is one of d(ays), h(ours), m(inutes) or s(s econds) already works (with an optional space between mutlitple NX).
Example:
khal new today 14:00 2h 30m meeting
I use khal frequently on the command line, so I have aliased it to
k
in my shell. But navigating around the calendar or agenda with giving the full date is a bit cumbersome, I always have to type so much ;-) It would be of great help to havekhal <date>
as a shortcut to print the agenda for that date.Then especially useful would be more date formats, e.g.
khal 23rd
would list the events at 23rd of the current month (maybe related to #169).To be honest, my intended use of khal is heavily influenced by my usage of taskwarrior, which allows to filter tasks easily by giving a filter expression as the first parameter, and the "show events from this date" feels much like such a "filter". The taskwarrior manual has a long list of useful synonyms and date abbreviations, some of which could be useful for khal also.