blakesweeney / unite-taskwarrior

A unite.vim interface to taskwarrior
6 stars 2 forks source link

:Unite taskwarrior/notes #22

Closed linuxcaffe closed 9 years ago

linuxcaffe commented 9 years ago

A new command that generates a list of uuid.tasknote.ext files found in the note-directory Displaying the filename and the first line of each tasknote, making it easiy to select from an otherwise meaningless list of UUID.ext.ext files.

blakesweeney commented 9 years ago

This seems pretty straight forward to do. I'd probably write another source Unite taskwarrior/notes which does what you suggest. Probably with actions like: open, preview, and delete.

blakesweeney commented 9 years ago

Try out the latest version. I've added a notes source which should do what you want. The only thing to note is that this plugin does not delete notes files by itself meaning your notes will include finished stuff. I'm not planning on adding features to cleanup the files since it's pretty normal to change task status outside this plugin.

linuxcaffe commented 9 years ago

That's the idea! Awesome! .. but .. ;-) (there's always a "but")

The path/filename is overkill (but showing the description is essential) so, if the first line of the tasknote is always the description, then one-line-per-tasknote shoulld be fine.

blakesweeney commented 9 years ago

That's a good point. I'll take care of that later.

linuxcaffe commented 9 years ago

I had an idea for a really nifty enhancement for taskwarrior/notes; Imagine if you will that the command opened a window with a 50/50 vertical split. On the left is the list of notefile first-lines, almost as it is now, but on the right is a preview of the file at the top of the list. As you cursor down over the list (on the left) the file preview on the right is refreshed, allowing the user to browse the contents of all the notefiles very quickly.

blakesweeney commented 9 years ago

This is nearly possible right now. If you try: :Unite taskwarrior/notes -auto-preview -vertical it will show the notes in a vertical split with a small preview window above. As you move along the candidate list it will preview. It does leave the current buffer visible, which may not be what you want but is pretty close I think. I don't quite know the right settings to get exactly what you want but this is pretty good.

Also, you can toggle this behavior. If you add:

nmap <buffer> <C-j>     <Plug>(unite_toggle_auto_preview)

to your unite settings then you can toggle this behavior in any unite source.

linuxcaffe commented 9 years ago

Aw man that's awesome! almost exactly what I was on about :)

Leaving the other buffer is not the end of the world, but maybe sub-optimal, and is there an easy way to split it so the first-line-list is on the left, and the preview on the right?

blakesweeney commented 9 years ago

Ok, I think doing:

:Unite taskwarrior/notes -auto-preview -vertical-preview -no-split

does exactly what you want. This will have a preview split vertically that shows automatically and will replace the current buffer with the unite windows. Doing that has some limitations, you should see :help unite-options-no-split for details on that.

linuxcaffe commented 9 years ago

that is soooo close! and that :help file is eye-opening! however, I didn't see a way to reverse the windows, left-and-right, because then it would be perfect! .. ok, without the path/filename lines.. but then it would be perfect! ;-)

blakesweeney commented 9 years ago

Try the set splitright in your vimrc. It will open notes to the right. The pathnames and such should be removed in the latest commits. Right now it should only display the header line of each file.

linuxcaffe commented 9 years ago

splitright worked like a charm, but I'm still seeing the path/filename line..

linuxcaffe commented 9 years ago

I take it all back, it ALL workslikeacharm!

linuxcaffe commented 9 years ago

I might highly recommend adding this as a default mapping;

nnoremap < silent >  < Leader >Tn :Unite taskwarrior/notes -auto-preview -vertical-preview -no-split< CR n >
(note: extra spaces added so the stupid githib thing will parse)

can the splitright be added to that, instead of separate vimrc config?

blakesweeney commented 9 years ago

I'm going to start collection mappings like this in the wiki and link to them in the readme. Feel free to suggest whatever you think would be a good addition there.

linuxcaffe commented 9 years ago

perfect! I'll share any cute configs I come up with, and maybe a screenshot or two.