Calendar.txt

Calendar.txt syntax.

Keep your calendar in a plain text file.

Calendar.txt is versionable, supports all operating systems and easily syncs with Android mobile phone.

 

Download calendar.txt template

 

How do I use calendar.txt? Open calendar.txt in any text editor and start filling in your events.

Edit calendar.txt in a text editor.

Example Calendar.txt

I've used calendar.txt for a while, and now I want to share it. Your new calendar in plain text:

2021-02-15 w07  Architecture week
2021-02-15 w07 Mon  9-12 project groups. 17 jogging. 
2021-02-16 w07 Tue  9-11 John 12-16 architecture meeting
2021-02-17 w07 Wed  8-14 +lp. 14:15-16 +mp
2021-02-18 w07 Thu  write out architecture
2021-02-19 w07 Fri  12-13 board
2021-02-20 w07 Sat  
2021-02-21 w07 Sun  10 ski with N
2021-04  Grand rollout
2022  The year of foobar

So it's

YYYY-MM-DD wWW Aaa  HH event. HH-HH another event. 

Benefits of plain text calendar

Simple. Your meetings and schedules are valuable. With calendar.txt, you know you what you wrote. You don't need to let "smart" calendar programs mangle your timezones.

Use your favourite editor. You can edit plain text with nano, vim, emacs, micro, gedit, mousepad, notepad, joe...

Future proof. You can open a text file in 2032.

Versionable. It's plain text, you can keep it in git. You can easily take diff, as it's one day one line.

Unix philosophy. It's one day, one line. You can grep (only show lines).

Sortable. When sorted in alphabethical order, the dates start from older and advace to future. Optional weekly goals are sorted at the start of each week.

Mobile friendly. For Android, you can synchronize your calendar.txt with Syncthing. For desktops and laptops, you can also use git.

What week is that? No more mixups between dates (2021-02-14) and week numbers (w06). In calendar.txt, week numbers are on the sime line, ready for copying.

Future is yours. For tomorrow, you want to know the hours. For the next year, you can plan the months. For five years, you can plan the years.

Tips and Tricks

Calendar.txt supports Unix philosophy on any platform. One line, one thing (day or goals).

Show all instances of Linux Basics course. The course is called "Linux perusteet" and the tag is +lp

$ grep +lp calendar.txt
2021-01-27 w04 ke       8-1345 +lp cli-sudo-apt; 14:15-1545 +mp groups and themes
2021-02-03 w05 ke       8-1345 +lp apache; 1415-1545 +mp
2021-02-10 w06 ke       8-1345 +lp vps+dns; 14-1545 +mp my groups
2021-02-17 w07 ke       8-1345 +lp flask; 1415-1545 +mp my groups
2021-03-03 w09 ke       8-1345 +lp bash-db; (14-1545 +mp); 1530 FxBar
2021-03-10 w10 ke       8-1345 +lp recap; (14-1545 +mp)
2021-03-17 w11 ke       8-1345 +lp final lab; (14-1545 +mp)

Only show March 2021 events for the course

$ grep +lp calendar.txt|grep 2021-03
2021-03-03 w09 ke       8-1345 +lp bash-db; (14-1545 +mp); 1530 FxBar
2021-03-10 w10 ke       8-1345 +lp recap; (14-1545 +mp)
2021-03-17 w11 ke       8-1345 +lp final lab; (14-1545 +mp)

Show both todos and calendar events for this course

$ grep +lp calendar.txt todo.txt
2021-03-17 w11 ke       8-1345 +lp final lab; (14-1545 +mp)
...
@N add article on Flask to reading list

I'm physically going to work tomorrow. Do I have any tasks or events? Let's search by @W (at work) context

$ grep @W calendar.txt todo.txt

Download ready made calendar

Download calendar.txt template. It has ready made calendar events until 2033. Feel free to copy just the part you need, such as half a year.

Rules

Calendar.txt syntax.

Rationale for some rules

Two spaces " " as date separator: many Android keyboards and editors make it slow to type tabs, but fast to type spaces. To make this unique and different from single space, two spaces is the minimum number of keystrokes.

Dates applying ISO-8601 standard YYYY-MM-DD: It's unambiguous. ISO-8601 dates sort nicely. Making the date part shorter for weekly, monthly and yearly goals makes also those goals sort correctly. And if you're a poster child of planning your life, you can easily make goals for a decade "202 PhD" or a century "20 World domination".

Week numbers near date. I need both date 2021-02-14 and week number w07. If I have to click around calendar UI to get them, week numbers and dates get mixed up. In calendar.txt, I can copy paste the whole thing "2020-02-14 w06 Sun".

Plus tags. Tags make it very fast to pick events with grep. Plus tags are already used with todo.txt. The other obvious alternative would be #hashtags, but as hash "#" is the comment character in bash shell, it would make many commands slower by requiring quoting.

Contexts, @W, @Work. Many of us spend most of their lives in 2-3 places. Why not give these places shorthand? Contexts are also marked this way in todo.txt, so it's convenient to use compatible syntax. You can, for example, pick all @W (work) events in both your calendar.txt and todo.txt.

Airport time. Having a "smart" calendar synchronization fiddle with your dates can really ruin your day. Calendar.txt follows "you wrote what you wrote" philosophy. Also, it's often expected that if you meet at a cafe in Helsinki at ten, that's local time. In the rare event you wish to use other timezones, such as Z (UTC) time, it's possible to mark it.

Having Mondays date in weekly goals. Some people use week numbers, others don't. So a common question would be: "w07, when does it start?". You have your answer already at hand. Also, this results in weekly goals sorting correctly in alphabetical sorting.

Downloads

To use calendar.txt, you just need to know the idea.

For your convenience, you can download a ready-made calendar.txt template with days and week numbers.

 

Download calendar.txt template

 

You're not going to need it before 2033, but here is the short go program to generate calendar.txt templates.

http://todotxt.org/ Keep your todo list in a plain text file. Compatible with Getting Things Done (GTD). I have used this for a long time, it was one of the inspirations behind calendar.txt.

https://syncthing.net/ Synchronize files to Android. No central servers required, end to end encryption. Works nicely with todo.txt and calendar.txt. Download Syncthing from F-Droid.

https://f-droid.org/en/packages/net.gsantner.markor/ Markor, a text editor for Android.

https://micro-editor.github.io/ Micro, a text editor for Linux, Windows and Mac.

Obviously, you can use calendar.txt on any operating system with any text editor.

Adminstrivia: This article has been updated.