todo.txt-vim icon indicating copy to clipboard operation
todo.txt-vim copied to clipboard

what about filtering?

Open colinsullivan opened this issue 8 years ago • 5 comments

What about the ability to filter arbitrarily, kind of like the todo.sh ls works?

Perhaps a command you run:

:todo.txt-filter @mytag +myProject

Would then re-order the file with all of the tasks matching the query on top, and the rest in a fold below?

I have little insight into how to accomplish this with vim+python and how the folding API works. Any thoughts?

colinsullivan avatar Mar 09 '16 17:03 colinsullivan

ping

@freitass is this out of scope in your opinion?

colinsullivan avatar Mar 21 '16 02:03 colinsullivan

Hi @colinsullivan, I didn't have the time to think about it yet. There were some attempts to implement something similar to this but I think your suggestion is the "least invasive" one. Wouldn't just sorting by context/project do the job?

freitass avatar Mar 21 '16 10:03 freitass

For example,

I want to see all my tasks in the +Next project, that have both contexts @work and @email.

If todo.txt-vim could put them all sorted together that would be good enough for me. My understanding is that this is not possible because todo.txt-vim is choosing an arbitrary method for resolving lines with multiple @contexts (just choosing the first one?)

It's approaching something like this:

https://github.com/AnthonyDiGirolamo/todotxt-machine

I'm not sure if that's where you want to go :)


Colin

On Mon, Mar 21, 2016 at 3:14 AM, Leandro Freitas [email protected] wrote:

Hi @colinsullivan https://github.com/colinsullivan, I didn't have the time to think about it yet. There were some attempts to implement something similar to this but I think your suggestion is the "least invasive" one. Wouldn't just sorting by context/project do the job?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/freitass/todo.txt-vim/issues/48#issuecomment-199211052

colinsullivan avatar Mar 22 '16 01:03 colinsullivan

Hey @colinsullivan , Just to let you know, I recently published gather-todo.txt, an extension to this plugin here. The core functionality is gathering and merging multiple todo.txt files (in a directory tree) in a scratch buffer. Thus, enabling some kind of agenda view in a temporary buffer.

As a nice side-effect, you can easily perform filtering in this scratch buffer with vim's basic functionality:

  • v/@interesting/d : Drop any todo items not containing the interesting context
  • g/+boringproject/d : Drop any todo items from the boring project.

Maybe this helps. I would be happy to receive some kind of feedback, what further functionality the plugin should provide (dispatching?, caching?).

Best Regards, lgalke

lgalke avatar Sep 19 '16 14:09 lgalke

FYI, I'm currently using Foldsearch for (kind-of) filtering. Works for me for now, still being newbie in terms of both todotxt and vim.

See also these SE questions:

  • https://stackoverflow.com/questions/862966/hide-all-notmatching-lines-in-vim
  • https://vi.stackexchange.com/questions/8770/how-can-i-hide-blank-lines-in-vim-without-actually-removing-them-from-the-text-i
  • https://vi.stackexchange.com/questions/5533/hide-certain-lines-completely-not-folding

myrdd avatar Mar 29 '19 10:03 myrdd