Skip to content
Brett Terpstra edited this page Mar 15, 2022 · 3 revisions

Most entry-modifying actions, such as finish, tag, and archive, allow filters to be specified and the relevant action to be performed on all matches. Don't forget, you can always undo the last operation with doing undo if anything unexpected happens.

In commands that support it, --tag= can be used to filter by tags. Multiple tags can be combined with commas, and --bool= can be used to determine whether to search for all the listed tags, any of them, or none of them.

--search can be used to filter entries matching a search string. Surround the string with slashes (e.g. --search "/query/") to perform a regular expression search, or start the string with a single quote (e.g. --search "'query") to perform an exact-match search.

Interactive Usage

FuzzyFileFinder (fzf) is included with Doing (https://github.com/junegunn/fzf), and you can use doing select to get a menu of all your items (or items in a given section) which can be searched with fuzzy matching. The menu allows multiple selections to be acted on directly. Most display commands also accept a --interactive (-i) flag to display an interactive menu of the results, followed by a menu of actions to perform on selected entries.

To use the menu, type a search string or use the arrow keys to navigate up and down. Tip: searching is "fuzzy" by default, but you can start your search with a single quote (') to force an exact match. Press tab on an entry you'd like to perform an action on. A marker will show up on the left indicating the entry is selected. Repeat the process and select as many entries as needed. When you hit Return, the selection will be passed back to doing. Use Control-A to select all visible entries.

Doing can perform several functions with this menu. Not all of doing's features are available, but the core functionality you'd need is there, plus you can open the selected entries on one page in your text editor, make changes to them, and when you save and close the entries are updated accordingly. This allows editing of everything from timestamps to tags to notes.

If no actions are specified, an interactive menu of options will be presented.

Run doing help select for a list of options:

-a, --archive         - Archive selected items
-c, --cancel          - Cancel selected items (add @done without timestamp)
-d, --delete          - Delete selected items
-e, --editor          - Edit selected item(s)
-f, --finish          - Add @done with current time to selected item(s)
--flag                - Add flag to selected item(s)
--force               - Perform action without confirmation.
-m, --move=SECTION    - Move selected items to section (default: none)
--[no-]menu           - Use --no-menu to skip the interactive menu. Use with --query to filter items and act on results automatically. Test with
                        `--output doing` to preview matches. (default: enabled)
-o, --output=FORMAT   - Output entries to format (csv|doing|html|markdown|say|taskpaper|template|timeline) (default: none)
-q, --query=QUERY     - Initial search query for filtering. Matching is fuzzy. For exact matching, start query with a single quote, e.g. `--query
                        "'search" (default: none)
-r, --remove          - Reverse -c, -f, --flag, and -t (remove instead of adding)
-s, --section=SECTION - Select from a specific section (default: none)
--save_to=FILE        - Save selected entries to file using --output format (default: none)
-t, --tag=TAG         - Tag selected entries (default: none)

For example, doing select -f -a would present the menu, and then mark selected entries as @done (with timestamp) and move them to the Archive section.

Multiple actions can be performed at once by combining options. You can also combine the --editor switch with any other options. Other actions will be performed first, then the entries --- with any modifications performed --- will be presented in the editor for tweaking.

Note: when using the --editor flag to open selections in your text editor, entries will be separated by --- lines. These must remain in place for doing to track the changes. You can do anything you want to the entries, modify dates, change text, add notes, etc., as long as you leave the dividers in place. You can even delete an entry entirely, leaving the dividers around the missing line and the entry will be removed from your doing file when you save and exit the editor.

The --editor flag can also be used with doing search to batch edit search results.