The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Taskwarrior::Kusarigama::Plugin::Command::Open - open links associated to a task

VERSION

version 0.12.0

SYNOPSIS

    # open the link(s) of task 123
    $  task 123 open

    # only consider the wiki link
    $ task 123 open wiki

DESCRIPTION

Looks into the annotations of the task for link thingies, and open them.

If the command finds exactly one link, it'll open it. If more than one is found, you'll be given the choice of which one you wish to launch.

The format for annotated links is format:path. The different formats live in the .taskrc. When installed, the plugin will set up the http and https format, but you can add as many as you want. E.g.

    $ task config kusarigama.plugin.open.http 'xdg-open {{{link}}}'
    $ task config kusarigama.plugin.open.https 'xdg-open {{{link}}}'
    $ task config kusarigama.plugin.open.wiki 'tmux split-window "nvim /home/yanick/vimwiki/{{{path}}}.mkd"'

The commands are Mustache templates (using Template::Mustache). The context provided to the template has three variables: link (e.g., wiki:my_page), path (my_page) and task, which is the associated task object.

Note that in the examples I'm using the triple bracket notation such that the '/' in the paths don't get escaped.

If you want to set more than one opening action for a type, append -action to it. E.g.:

    $ task config kusarigama.plugin.open.wiki 'cat "/home/yanick/vimwiki/{{{path}}}.mkd"'
    $ task config kusarigama.plugin.open.wiki-edit 'tmux split-window "nvim /home/yanick/vimwiki/{{{path}}}.mkd"'

    $ task open wiki         # prints it 
    $ task open wiki-edit    # opens editor

INSTALLATION

    $ task-kusarigama add Command::Plugin

SEE ALSO

https://github.com/ValiValpas/taskopen - shell-based inspiration for this plugin.

AUTHOR

Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2019, 2018, 2017 by Yanick Champoux.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.