davidoc/taskpaper.vim — pull request #17 by Darchangel (2011-10-22 00:19:54+00:00)
Title: Pull Request: @active tag

Hi!

I'm a fan of the taskpaper format and vim, so naturally I use your plugin very much.

I've recently felt the need to mark a tag as the active one, and felt that is a little more important than just another tag. So I've forked your repository and added syntax and hotkey support for that tag. Now, any task marked with @active is highlighted in the "TODO" color (pink-ish in my color scheme). I've also added a hotkey, tq, to toggle the current @active tag (I'll explain more below).

As I think more people might appreciate this functionality, I'm making this pull request so that, if you agree, this code can be made available to everyone.

I've changed the syntax file to add highlight support and the ftplugin file for the hotkey function.
I haven't touched the doc files because I don't know very well how the vim doc syntax works yet, and also because I didn't want to mess up anything.

Anyway, the documentation for this function is the following:

************************************ DOCUMENTATION ***************************************
- Any task (only tasks, not projects) can be marked as @active

- The hotkey tq will toggle the current @active task in different ways, depending on a variable's value
(note: ta was already taken, so I used tq)

- That variable is task_paper_active_tag_removal_scope, and can be set in the b:, t:, w: or g: scopes (the innermost scopes will override the outermost)

-The variable can have 3 values:

- "FILE": This means that there can only be one task marked @active in each file. When a task is marked @active (with the hotkey) all other tasks marked @active will have that tag removed (even if they were marked @active by hand). This is the default value (used if the variable is not defined)

- "PROJECT": This means that there can be one active task per project. If a task is marked @active, all other tags in the same project will have the @active tag removed. Tasks in other projects are left untouched.

- "NOTHING": This removes any restriction whatsoever on the @active tags. With this setting, any number of tasks in a file can have the @active tag.
************************************ END DOCUMENTATION ***************************************

I hope you agree with me that this can be a useful feature. Anything you need to ask me, feel free to do it.
If you want me to write the documentation for this code, I can do it. Just tell me where to put it (in which section, before/after what text, what links I should include) and I'll do it.

Thank you very much for the plugin. It's very helpful!

Filipe Silva