PTPL 196 · How to Filter a todo.txt File in Obsidian — Without Plugins - Ellane W

7 min read Original article ↗

Recently I mentioned that all my to-dos get thrown into one text file, in the todo.txt format. It’s incredibly quick to add new tasks. And once you know some simple formatting rules, it’s also easy to see just the tasks you want to see, when you want to see them.

By the end of this article you will understand how to create, adjust, and reuse saved searches in Obsidian to filter a todo.txt file into useful views, without (additional) plugins. You will also be able to embed these searches anywhere you wish to see them in your files, such as in a daily or weekly note.

Tracking tasks in Obsidian, todo.txt-style

What I need the system to do

I want an easy way to capture tasks, and to see subsets of them at specific times. The solution must fit my plain text requirement, which is that all important information must exist as a text document that can be read by any text editor on any device or platform.

I want to see tasks when past-me decided I should look at them again. They should fall under the following headings:

  • Today
  • This week
  • This month
  • Later

This is what a task list pulled from a todo.txt file can look like in Obsidian:

Screenshots of two Obsidian windows, side by side. The first shows 3 headings in a single Obsidian file: Today, This Week, This Month. Under each heading are the results of an embedded search. The second shows the same page, in source mode, showing the query code that produced the output seen in the other window.

Queries are on the left, results on the right


How to structure tasks so it works

The official todo.txt format is easy to learn. It is also flexible, and can be tailored to your needs.

Here are the basic rules:

screenshot from https://github.com/todotxt/todo.txt explaining the elements of the todo.txt syntax Screenshot from https://github.com/todotxt/todo.txt


My task mangagement system is centred on when tasks need to be looked at, so I use priorities as follows:

  • (A) = Today
  • (B) = This week
  • (D) = This month
  • (L) = Later (L tasks need to be done sometime after this month)
  • (Z) = Maybe. These are the sleeping to-dos; they are ideas for tasks that I don’t want to lose.

You can use any letters you like for time categories, as long as alphabetical order = chronological order.

I also add tags to indicate which broad calendar category a task belongs to, and months of the year or days of the week to designate repeating tasks. Tags are useful when time blocking. I use them instead of the todo.txt contexts as they are clickable in Obsidian and @contexts are not. This means I can click on a #tag and immediately be taken to all instances of that tag in Obsidian.

And that’s it! Start simple. No task will slip through the cracks as long as you do these two essential things:

  1. Add a time code (priority) to the beginning of the task
  2. Review time categories regularly

Obsidian Search guide

Searches in Obsidian can appear in three different locations.

  1. Bookmarks in Obsidian seem handy, but the search terms aren’t editable. If you need to change what you’re looking for you must save the bookmark all over again. I’m not the only one who would like to see this change.

  2. The Search box in the side bar shows the same list as an embedded query, but the search terms are often cut off due to the width of the search box. This makes it harder to see what you’re doing when edits need to be made to the search parameters. Once again, I’m not alone in hoping this will change.

  3. Embedded queries are saved searches that can be viewed inline with whatever other text you have on a page. They can be edited, and can easily be hidden, if needed, by placing them under a header and folding them out of sight.

Embedded queries are perfect for working with a todo.txt file! I use them extensively as a convenient way to see just the tasks I’m interested in, right there on today’s date.

To add a query to a page, you will write what you would normally put into the search box, and place that text inside a code block, like this:

```query
file:todo "(A)"
```

That search will find every instance of the text (A) in the file named todo. Note: In Obsidian that file would be todo.md, not todo.txt.

More complex Obsidian search terms

Here are some more searches, covering most scenarios you’ll face with a file in the todo.txt format, named todo.md.

Tasks assigned to this week, that have the category of admin:

```query
file:todo line:("(B)" "#admin")
```

Tasks assigned to this month, that do not contain the tags errand or buy:

```query
file:todo-txt line:("(D)" -("#errand" OR "#buy"))
```

Tasks assigned to today, in the admin/work category, across multiple files in a folder named TODO, but excluding the sub folder Archive:

```query
path:(TODO -Archive) line:("(A)" "#admin/work")
```

Tasks assigned to today or this week, that do not yet have a category (tag) assigned — note the grouping of terms within parentheses:

```query
file:todo line:(("(A)" OR "(B)") -"#") 
```

Adding RegEx to Obsidian search terms really opens things up! This next search shows tasks from any file in the TODO folder (but not the Admin sub folder) with due/review dates between 2026-02-21 and 2026-03-21. Excludes creation dates, includes any 2026 date beginning with a colon.

```query
path:(TODO -Admin) line:/\s:2026-(02-(2[1-9])|03-(0[1-9]|1[0-9]|2[01]))/
```

The Obsidian Help guide to Search recommends the freecodecamp and Mozilla guides to RegEx.

Declaration in the interests of transparency: I used an AI agent to help me generate the RegEx in the above example. AI isn’t allowed to write words for me, but I’m happy to let it show me things I haven’t learned yet, but can check the accuracy of in the field.

What to do with completed tasks

Completed tasks in the todo.txt format have a lower case x added to the front. If a task has a creation date, you have the option to add a completion date directly in front of it. You can then either exclude completed tasks from your searches, delete them, or cut and paste them into a dedicated done file.

I like using the Todo.txt Mode Obsidian plugin for its customisable syntax highlighting, sorting, and archiving abilities. This plugin sends all completed tasks to the done file with a keyboard shortcut.

There are other todo.txt plugins for Obsidian, but none that appeal to me. You can also use any of the dedicated todo.txt tools out there on your to-dos should you leave Obsidian behind; keeping tasks in plain text means they will never be tied to any one app.

You made it!

Congratulations! You should now be able to extract just the tasks you want to see from a todo.txt file, in Obsidian.

But why stick with vanilla Obsidian search? Why not use Dataview, or Obsidian Bases? Because the latter are for querying the properties in structured files, where each piece of information lives in it’s own file; not a messy throw-it-all-in list. With a todo.txt file you are searching for patterns of text, not running a database.

I want to stress that embedded queries (saved searches) in Obsidian are solely for convenience. This is important because my task file would still be just as independently useful if Obsidian were to disappear. I can see what tasks are on my list just as easily in VS Code as I can in Obsidian, minus the convenience of embedded queries.

One last tip: Make things easier for your future self when writing complex queries in Obsidian, by writing a hidden comment above them to explain what they do. E.g.

<!-- due/review dates between 2026-02-21 and 2026-03-21 -->
```query
path:(TODO -Admin) line:/\s:2026-(02-(2[1-9])|03-(0[1-9]|1[0-9]|2[01]))/
```

Important notes:

  • Obsidian search terms will not work in any other app, thus placing them squarely on level 3 of the plain text productivity scale
  • Obsidian search can do a whole lot more than what is covered here. Explore the official knowledge base
  • There are a lot of Obsidian-free ways to work with todo.txt files, including dedicated apps and CLI tools

💬 I love to hear from readers! email hello at ellanew dot com or message me on Mastodon or Bluesky. Follow my RSS feed, or sign up to receive a weekly plain text themed email.

If you’ve found value here I invite you to share this post with someone you think will appreciate it, or make a contribution to my support jar

... ... ... ...