From 954b6d4220cba8f74efcf63fec0416acfd91a17c Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 11 Aug 2020 12:16:26 -0400 Subject: [PATCH] Add .taskrc and functions for working with taskwarrior --- .config/fish/functions/define_aliases.fish | 2 +- .config/fish/functions/tasko.fish | 4 +++ .config/fish/functions/taskwiki.fish | 9 ++++++ .taskrc | 37 ++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .config/fish/functions/tasko.fish create mode 100644 .config/fish/functions/taskwiki.fish create mode 100644 .taskrc diff --git a/.config/fish/functions/define_aliases.fish b/.config/fish/functions/define_aliases.fish index 660e49b..55f7c16 100644 --- a/.config/fish/functions/define_aliases.fish +++ b/.config/fish/functions/define_aliases.fish @@ -7,7 +7,7 @@ function define_aliases -a uname -d 'Defines aliases for commonly used commands' alias tocb 'xclip -in -selection clipboard' alias fromcb 'xclip -out -selection clipboard' alias ssh-rm-host 'ssh-keygen -f ~/.ssh/known_hosts -R' - alias wiki 'nvim +VimwikiIndex; and exit' + alias wiki 'nvim +VimwikiIndex' switch "$uname" case 'Linux' diff --git a/.config/fish/functions/tasko.fish b/.config/fish/functions/tasko.fish new file mode 100644 index 0000000..e5b4061 --- /dev/null +++ b/.config/fish/functions/tasko.fish @@ -0,0 +1,4 @@ +function tasko -a id -d 'Open the link of a taskwarrior task by id' + set link (task _get $id.link) + if test -n $link; open $link; end +end diff --git a/.config/fish/functions/taskwiki.fish b/.config/fish/functions/taskwiki.fish new file mode 100644 index 0000000..7df2ccb --- /dev/null +++ b/.config/fish/functions/taskwiki.fish @@ -0,0 +1,9 @@ +function taskwiki -a id + set page (task _get $id.wiki) + + if test -n $page + $EDITOR +VimwikiIndex "+VimwikiGoto $page" + else + echo 'no wiki file specified' + end +end diff --git a/.taskrc b/.taskrc new file mode 100644 index 0000000..c11a7dd --- /dev/null +++ b/.taskrc @@ -0,0 +1,37 @@ +# [Created by task 2.5.1 8/10/2020 11:48:16] +# Taskwarrior program configuration file. +# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color', +# 'man task-sync' or 'man taskrc' + +# Here is an example of entries that use the default, override and blank values +# variable=foo -- By specifying a value, this overrides the default +# variable= -- By specifying no value, this means no default +# #variable=foo -- By commenting out the line, or deleting it, this uses the default + +# Use the command 'task show' to see all defaults and overrides + +# Files +data.location=~/.task + +# Color theme (uncomment one to use) +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/light-16.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/light-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-16.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-red-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-green-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-blue-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-violets-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-yellow-green.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-gray-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/dark-gray-blue-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/solarized-dark-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/solarized-light-256.theme +#include /usr/local/Cellar/task/2.5.1/share/doc/task/rc/no-color.theme + +uda.link.type=string +uda.link.label=Link +uda.file.type=string +uda.file.label=File +uda.wiki.type=string +uda.wiki.label=Wiki