Todo.txt For Emacs (todotxt.el)
Todo.txt is a tool written by Gina Trapani and a community of eager hackers. It allows the management of a text-based simple todo list manager from the command line. Because it is text, it can be used on just about any computing device, and therefore has inspired tools written in a variety of languages on an array of platforms.
There is a long and glorious tradition of using plain text for a myriad of tasks, and Emacs is one of the best tools around for working with plain text. It is in this tradition that todotxt.el was written. It aims to provide a fast, easy and effective mechanism for creating or accessing your existing Todo.txt lists from the comfort of your Emacs session.
Of course, it is completely compatible with all the features from Todo.txt CLI and Todo.txt Touch (on Android) including contexts, projects and priorities. It supports filtering by context and project with tab completion, and has fairly good support for common actions associated with tasks including:
- Listing all tasks (‘l’)
- Navigation up and down (‘p’ or ‘k’ for up and ‘n’ or ‘j’ for down)
- Showing only incomplete tasks (‘i’)
- Adding a task (‘a’)
- Completing a task (‘c’)
- Tagging a task (‘t’) with a project and/or context
- Setting the priority on a task (‘r’)
- Archiving completed tasks in
- Freeform editing of a task (‘e’)
- Progressive filtering of the task list (‘/’)
- Saving (’s’) (usually not needed; most actions are saved automatically)
- Reverting (‘g’) in case the buffer has been edited using an external tool
- Undo (‘u’) in case something goes wrong =)
Installation is easiest through the MELPA package. You can also check out the code and install manually:
- You’ll need to put todotxt.el somewhere on your Emacs
- Load todotxt using
(require 'todotxt)in your
.emacs(or other initialization) file. You can load it for evaluation by typing that command either into an evaluation prompt (
M-:) or by putting it in
C-jat the end of the line
Regardless of install mechanism (MELPA or manual), a small bit of setup is useful:
- Tell todotxt where your
todo.txtfile is. You can do so by customizing the variable
todotxt-fileeither by editing your initialization file or by simply using
- You can then interact with your todo list using
- Bind the
todotxtfunction to some accelerator like
(global-set-key (kbd "C-c t") 'todotxt)
You can list all the tasks in the file using
l. From there, you
may want to pare it down using
i to only show incomplete tasks,
or by filtering (see below).
You can add a new task with
a. Just type the task into the
minibuffer and press
You can filter the list using
/. This supports completion of any
tags (either projects [ indicated with a
+ ] or contexts [
indicated with a
@ ]) using
tab, or you can type in any keyword
or phrase you want to filter the list. Only lines containing that
word or phrase will be shown.
Filtering is progressive by default, meaning that each time you
filter, it filters the visible list. To disable progressive
filtering when invoking, pass the universal argument to the filter
command, i.e. instead of just pressing
C-u /, which
will filter the entire list, not just the visible entries.
You can add a tag (again, either a project or a context) with
This will then prompt you for a tag, which it will append to
selected item. If you want to add a tag that already exists, you
can use tab-completion to fill it in.
You can add (or remove, keep reading) a priority on an item with
r. If the item already has a priority, it will be overwritten.
If the item has a priority and you simply press
specifying a new one, the current priority will be deleted.
Priorities should be a single character in the range A-Z.
Sometimes the built in features aren’t enough, and you just want to
do some freeform edits on an item. This is easy to do with
When you’re finished editing, just press enter and your changes
will be saved.
A task’s completion state is toggled with
Completed tasks can be moved to the file
Like many other modes in Emacs, todotxt is meant to be brought up
when you need it and dismissed just as quickly. You can do so by
- There’s no indication that the list is filtered. If you’re unsure
of the filter state, press
lto make sure you’re really seeing all the items.