Skip to content
Brett Terpstra edited this page Feb 17, 2022 · 4 revisions

Shell completion

You can install completion scripts for your shell using doing completion install SHELL, where shell is zsh, bash, or fish. The built-in completions will be installed to ~/.local/share/doing/completion/ and symlinked into an appropriate auto-load folder for your shell. If you opt not to create the link, the path to the file will be provided and you can source it from your login files or link it yourself.

The built-in scripts cover all of the default commands and plugins, but if you've hidden commands or have custom commands and plugins, ou can generate new completion scripts using doing completion generate SHELL. These will be saved to ~/.local/share/doing/completion/ by default. You can specify an alternative output file using --file PATH. generate also accepts --stdout to output the results to STDOUT which can be piped/redirected any way you need to.

You can find scripts in the repository (generated by the above command, irregularly, may or may not have the latest commands/options):

Bash: See the file doing.bash in the git repository for full bash completion. Thanks to fcrespo82 for getting it started.

Zsh: See the file _doing.zsh in the git repository for zsh completion. Thanks to Gabe Anzelini for getting this started.

Fish: See the file doing.fish in the git repository for Fish completion.

I really only use Fish these days, so I'm not doing a lot of testing on the Zsh and Bash scripts. If you have suggestions/corrections for the completion scripts, please create an issue and let me know how I can improve them.

Launchbar/Alfred

The LaunchBar action requires that doing be available in /usr/local/bin/doing. If it's not (perhaps because you're using RVM or similar), you'll need to symlink it there. Running the action with Return will show the latest 9 items from Currently, along with any time intervals recorded, and includes a submenu of Timers for each tag.

Pressing Spacebar and typing allows you to add a new entry to currently. You an also trigger a custom show command by typing "show [section/tag]" and hitting return. Include any command line flags at the end of the string, and if you add text in parenthesis, it will be processed as a note on the entry.

Point of interest, the LaunchBar Action makes use of the -o json flag for outputting JSON to the action's script for parsing.

See https://brettterpstra.com/projects/doing/ for the download.

Evan Lovely has created an Alfred workflow as well.