blindFS / vim-taskwarrior

vim interface for taskwarrior
Other
518 stars 42 forks source link

history, marks, sessions and the backspace key #56

Open linuxcaffe opened 11 years ago

linuxcaffe commented 11 years ago

(this is a doozy!, and probably not for v1.0)

This is a "meta" feature-request, that involves all of the above, so please bare with me.

There are times when I'm playing with vim-taskwarrior, come upon an good combination of layout and filters, and then hit another key, and wish I could "go back", but I have to retrace my steps instead. That's where the backspace-key comes in. I'm wondering if it would be possible to save a "display-condition" (combination of report, filter, sort, column-format) to one of vim's 0-9 marks registers. Rather than record every keystroke, vim-tw might save the previous display-condition every time a new report is invoked.

These 10 "snapshots" would allow nine steps back (marks 1-9) with the backspace-key. To save the current condition to the history, without navigating away, the key combo `0 (go to where you are now) could be used.

Combinations of report+filter+ sorting+format-overrides could be used to create more complex, special-purpose views, and those views could be saved using vim's a-zA-Z marks, things like;

`A = the "A" list of projects and tags
`q = "quicklist, with duration.under:10min
`F = financially related projects and tags
`h = home related
etc. 

None of these would come out-of-the-box, but created by users as needed. The "B" key (for Bookmark) could be used in exactly the same way that regular vim uses "m" followed my the desired mark, and the mark is called like usual, with a backtick-key-combination.

Vim sessions could be used to automatically save all of the marks 0-9a-zA-Z, and an option could be added for vim-taskwarrior to start in the display-condition you were in when you closed it.

Could be used to walk back the marks 1-9, and shift-backspace-key (if that's even possible) could be used to "walk forward" again. The backspace key also has a role to play when (not if) "taskwiki" (task + vimwiki) comes to life. There are ideas floating around for creating links from taskwiki to jump to pre-defined vim-tw reports/filters, and when that happens, some facility to jump back to the wiki with the backspace key would be the vimwiki-way.

I have to admit that I'm no expert with these vim features, but if they could be used as described above, I think it would provide substantial benefits to users.

blindFS commented 11 years ago

Good idea

blindFS commented 11 years ago

I don't agree with the mark/register part. It should not override too many of vim built in functions.(side-effects)

My idea:

A log file, recording all historical combinations. forward/backward action. (I prefer K/J key for that)

A bookmark file, recording user defined bookmarks. open/new/remove action (vim quickfix window).

linuxcaffe commented 11 years ago

That sound like it would have about the same result, do you think marks are basically unusable in vim-tw then?

On 12 November 2013 20:59, zc he notifications@github.com wrote:

I don't agree with the mark/register part. It should not override too many of vim built in functions.(side-effects)

My idea:

A log file, recording all historical combinations. forward/backward action. (I prefer K/J key for that)

A bookmark file, recording user defined bookmarks. open/new/remove action (vim quickfix window).

— Reply to this email directly or view it on GitHubhttps://github.com/farseer90718/vim-taskwarrior/issues/56#issuecomment-28355649 .

blindFS commented 11 years ago

No need I think. The quickfix window is better. Quickfix window seems not possible.

Actually adding unite.vim extensions is the best in terms of user experience, however I don't want this plugin to have too many dependencies.

I will search for a fallback solution but I will stay away from using marks.