itchyny / calendar.vim

A calendar application for Vim
MIT License
1.95k stars 72 forks source link

Extended Task Features #50

Closed jebaum closed 9 years ago

jebaum commented 10 years ago

Assuming they aren't already implemented and I somehow just missed it, could a couple of features be added for tasks? Namely being able to set due dates, add notes for tasks, and perhaps even reorder tasks within a list although (imo) that's the least essential.

All of these operations seem to be supported by the google tasks api, so it should be possible: https://developers.google.com/google-apps/tasks/v1/reference/tasks/update https://developers.google.com/google-apps/tasks/v1/reference/tasks#resource

I'd take a crack at implementing this myself if you're ok with the idea.

itchyny commented 10 years ago

If you send me pull requests, I'll review and merge the patches.

jebaum commented 10 years ago

Haven't had a ton of time for this, but a couple initial thoughts.

I'm having a hard time wrapping my mind around the overall structure of the code, probably because I've never seen vimscript quite like this before. It seems like it's very well designed and probably easy to work with once you understand the structure, but I'm not quite there yet. If you're interested in these features you could definitely implement them a hell of a lot quicker than I could.

Also, with these features I think it would be beneficial to have a buffer just for viewing tasks, in order to be able to nicely display task notes and due dates, as well as multiple task lists.

For reference, the personal use case I'm trying to address is having several different task lists, one for each class in a semester, and adding assignment details and due dates to those tasks.

itchyny commented 10 years ago

I'll implement some features then, but please write the features you want in a list style. For example,

is the feature I want now.

Creating a special buffer just viewing the tasks will be an easy work to implement, but adding some editing feature to that buffer (editing tasks or deleting tasks and saving back to Google Task) will be a hard work.

jebaum commented 10 years ago

More detailed breakdown:

Yeah, if you implement part of this, just being able to see the diff of how you did it will probably help me work on the rest

itchyny commented 10 years ago

I added the due-date feature: inserting a task by 2014-9-1 do something' adds the due date 2014-9-1. I added the note feature: inserting a task bydo something notes: foo baradds the notesfoo bar`.

petobens commented 10 years ago

It would be really great to have multiple tasks! +1

itchyny commented 10 years ago

I don't get it. It is possible to have multiple tasks. If you mean multiple tasklists, a collection of tasks, the answer is again yes, it is already implemented.

petobens commented 10 years ago

@itchyny Thanks for your reply. I think I'm not quite understanding what you mean. Suppose I want to have two separate tasklists: Work and Home. Each tasklist has a multiple (different) tasks. Currently what I'm doing is writing these two tasklists in the unique Task List that is shown in the task window (and separating them by a blank line). You can see this in the image below.

I guess that what I meant in my previous comment was if it was possible to have two separate Task List windows.

screenshot-06-09-2014_17-06-07

petobens commented 10 years ago

I'm now using let g:calendar_google_task = 1 and finally understood that multiple tasklist feature is indeed implemented and works great. I have three question: i) is there a mapping to switch between each of this taskliskts? i.e from the Home tasklist to the Work tasklist; ii) Is it possible to open the app and focus directly on the tasklist? Current I first open the app with the :Calendar command and then press T to open the tasklist and iii) is it possible to have the tasklist always open and visible? Currently the calendar is always visible but the tasklist window must be closed or hidden in order to return to the Calendar.

itchyny commented 10 years ago

The answers are: i) No, not implemented. ii) No. This is a calendar plugin. iii) Just press <Tab> key.

petobens commented 10 years ago

i) Okay, no problem. I think however that it would be useful to have it. ii) I tried to implement it in my vimrc like this au BufWinEnter * if &ft ==# 'calendar' | normal T | endif but it didn't work. Can you provide some guidance as how to make it work? iii) Thank you, I didn't know about the <Tab> mapping.

petobens commented 9 years ago

@itchyny I'm sorry to bother you again. First of all let me say that this is a great plugin that I use on a daily basis. One thing that I would really like to achieve is what I mentioned as the second point in my previous comment:

ii) I tried to implement it in my vimrc like this au BufWinEnter * if &ft ==# 'calendar' | normal T | endif but it didn't work.

Although I understand this is a Calendar app I would really like to have the Tasklist open once the app starts. Since you know way more vimscript than I do, can you suggest a way of doing this? (i.e something I can put in my vimrc)

itchyny commented 9 years ago

Either one of the following settings might be the solution.

autocmd FileType calendar call feedkeys("\<Plug>(calendar_task)")
autocmd FileType calendar call feedkeys("\<Plug>(calendar_task)\<Plug>(calendar_tab)")

Or in short,

autocmd FileType calendar call feedkeys("T")
autocmd FileType calendar call feedkeys("T\<Tab>")

However, these ways are not intuitive and the screen is redrawn multiple times. I'd like to add an option/flag to start the app with the tasklist open.

petobens commented 9 years ago

@itchyny thank you!!

autocmd FileType calendar call feedkeys("\<Plug>(calendar_task)\<Plug>(calendar_tab)")

is exactly what I need (at least until you decide to add or not the flag). Thanks again for developing this app!

itchyny commented 9 years ago

Now you can enable the visibility of the task list on startup by

let g:calendar_task = 1

or

:Calendar -task
petobens commented 9 years ago

@itchyny great! thank you!!!