What's todo_completer.sh?
todo_completer.sh works in conjunction with todo.sh and completes/suggests actions, projects and contexts when you hit the Tab key.
For example, hitting the Tab key after typing t a (where t is aliased to todo.sh) results in:
$ t a
add append archive
Or, typing t list @ and hitting Tab will list all the contexts you've used before, like:
$ t list @
@email @office @online @pc @shopping @waiting
todo_completer.sh was authored by Pedro Melo.
Download todo_completer.sh
Download the latest version of todo_completer.sh. (Here's the browser-friendly version).
Installation
- Save the file to ~/.bash_completion.d/todo_completer.sh.
- Add the following lines to your ~/.bashrc (Mac users: ~/.bash_profile, Cygwin users ~/.profile):
source ~/.bash_completion.d/todo_completer.sh
- If you've aliased todo.sh to t, also add the following line to ~/.bashrc (Mac: ~/.bash_profile, Cygwin users ~/.profile):
complete -F _todo_sh -o default t
Replace the t in the second line to whatever you aliased todo.sh to. - To load your .bashrc (or .bash_profile or .profile) changes:
$ source ~/.bashrc
Mac users, do:
$ source ~/.bash_profile
Cygwin users, do:
$ source ~/.profile
Notes
- todo_completer.sh assumes that the todo.sh configuration file is at ~/.todo. If in your case you have it in a different place, set the TODOSHRC environment variable.
- todo_completer.sh can't handle the : in the project p: notation. If you denote projects with + instead, completing projects will work.
-
Mac users, here's help viewing/editing files and folders that start with a dot.
Author
Unless otherwise noted, all the todo.txt scripts published herein are authored by Gina Trapani and licensed under the GNU General Public License.
Scripts and text originally published as an ongoing Todo.txt series at Lifehacker.com. Special thanks to all the Lifehacker readers who contributed to Todo.sh by fixing code, adding features, reporting bugs and making suggestions.
All software comes as is with no warranty. Do back up your todo.txt before you read another word. Questions, support and help is available in the Todo.txt Mailing list.
