add todo.txt-cli as a plugin
Since it is referenced in the default .bash_profile and in aliases and themes, why not make it an official plugin? This creates a 'todo/' directory in /plugins/available, and installs todo.sh and friends there. Tab completion and the 't' alias should work out of the box. Note: it was also necessary to modify .gitignore to ignore the files todo.sh generates in custom/.
This commit is contained in:
13
plugins/available/todo.plugin.bash
Executable file
13
plugins/available/todo.plugin.bash
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
export TODO_DIR=$HOME/.bash_it/custom # store todo items in user's custom dir, ignored by git
|
||||
export TODOTXT_DEFAULT_ACTION=ls # typing 't' by itself will list current todos
|
||||
|
||||
export TODO_SRC_DIR=$HOME/.bash_it/plugins/available/todo
|
||||
|
||||
# respect ENV var set in .bash_profile, default is 't'
|
||||
alias $TODO='$TODO_SRC_DIR/todo.sh -d $TODO_SRC_DIR/todo.cfg'
|
||||
|
||||
export PATH=$PATH:$TODO_SRC_DIR
|
||||
source $TODO_SRC_DIR/todo_completion # bash completion for todo.sh
|
||||
complete -F _todo $TODO # enable completion for 't' alias
|
||||
Reference in New Issue
Block a user