itchyny / calendar.vim

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

Integration with vimwiki #49

Closed lervag closed 10 years ago

lervag commented 10 years ago

I just recently noticed your calendar plugin, and I am impressed. It looks amazing!

However, there is one major feature that I miss, and that is implemented in Matsumotos calendar plugin: A calendar action hook. This hook is used by vimwiki to let the function vimwiki#diary#calendar_action open the current chosen date with <cr>.

itchyny commented 10 years ago

I do not know what vimwiki is but I think that you can achieve by the following configuration:

autocmd FileType calendar nmap <buffer> <CR> :<C-u>call vimwiki#diary#calendar_action(b:calendar.day().get_day(), b:calendar.day().get_month(), b:calendar.day().get_year(), b:calendar.day().week(), "V")<CR>
lervag commented 10 years ago

Thanks, that works. I also noticed one more thing, but that might be too much to ask: Matsumotos calendar also adds a hook that allows to add a prefix or suffix to a date entry. This is used by vimwiki to add a star infront of dates that have diary entries.

This is not a big deal, but it is very convenient.

Here is vimwikis hook. Here is how the hook is connected to the calendar. Finally, here and here is how the sign is applied.

lervag commented 10 years ago

Note: The important thing here is to mark calendar date. It need not be through a prefix or suffix, it could also be through syntax highlighting. That might indeed be even better.

itchyny commented 10 years ago

In the first stage of developing this plugin, I was to implement that kind of interface to interact with other plugins. However, I got less interested because it seems that this plugin itself is useful enough. I use this plugin as diary, by writing what was on as a new event everyday. Wiki, like vimwiki, can be dealt inside this plugin, I have not tried that plugin though.

lervag commented 10 years ago

vimwiki is much more than just a diary, and a very useful plugin. If you have not tried it, I suggest you look at it.

However, I respect your choice in this matter. I'm happy now that the mapping works. I would of course be very happy if you would reconsider.

thorlucas commented 3 years ago

Has there been any update regarding this matter? I would love to be able to mark a day that has a diary entry.