VO Calendar Enhancement

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

VO Calendar Enhancement

Noel Henson
I know that Stefan is already very busy but I'd still like to discuss some
VO Calendar enhancements.

I'd like to add a command the closes all folds then completely opens the
fold for today. Here is my version of that command:

function! GoToToday()
        set foldlevel=0
        call search(strftime("%Y-%m-%d"))
        normal! zozozozczOzz
endfunc

I've also been toying with the calendar.vim plugin. I think someone has
already mentioned it. It has some cool features like displaying three
months at a time in a format we are all used to. It also supports editing
of external 'diary' files by double-clicking on a date.

I think it might be an easy task to the same for VO Calendar. It could look
like this:

www.vimoutliner.org/files/vocalshot.png

The '+' next to 9/22 indicates that one or more children of one of the
default headings exists. The '*' indicates today. If one double-clicks on
a date, it would close all folds and fully open the fold for the date
clicked on.

I know I used the word 'easy' above. I think it might be if we got
permission to use much of the calendar.vim code. We'd only need to change
the file edit routines.

Thoughts?

Noel

--

------------------------------------------------------------------
  Noel Henson
  www.noels-lab.com Chips, firmware and embedded systems
  www.vimoutliner.org Work fast. Think well.

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: VO Calendar Enhancement

Stefan Schmiedl
Noel Henson (28.09. 09:26):

>
> function! GoToToday()
> set foldlevel=0
> call search(strftime("%Y-%m-%d"))
> normal! zozozozczOzz
> endfunc

you can shorten it a bit with    
  normal! 3zozczOzz

>
> I think it might be an easy task to the same for VO Calendar. It could look
> like this:

yup ... store the following in mycal.vim
========== mycal.vim ==========
function! MyCal(d,m,y,w,r)
  let l:day = a:d<10 ? '0'.a:d : a:d
  let l:month = a:m<10 ? '0'.a:m : a:m
  let l:tag = a:y.'-'.l:month.'-'.l:day
  wincmd l
  execute "tag ".l:tag
  normal! 3zozczOzz
endfunction
let calendar_action = 'MyCal'
========== mycal.vim ==========

open a calendar buffer in vim
in the calendar buffer type :source mycal.vim
move cursor to interesting day in calendar buffer
type <Return>

s.
--
Stefan Schmiedl
+-------------------------------+----------------------------------------+
|Approximity GmbH               | EDV-Beratung Schmiedl                  |
|http://www.approximity.com     | Am Bräuweiher 4, 93499 Zandt, Germany  |
|mailto:[hidden email]  | Tel. (09944) 3068-98, Fax -97          |
+-------------------------------+----------------------------------------+
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: VO Calendar Enhancement

Detlef Steuer
In reply to this post by Noel Henson
Hi all!

On Wed, 28 Sep 2005 09:26:20 -0700
Noel Henson <[hidden email]> wrote:


> I've also been toying with the calendar.vim plugin. I think someone
> has  already mentioned it. It has some cool features like displaying
> three  months at a time in a format we are all used to. It also
> supports editing  of external 'diary' files by double-clicking on a
> date.
>
> I think it might be an easy task to the same for VO Calendar. It could
> look  like this:
>
> www.vimoutliner.org/files/vocalshot.png
>
> The '+' next to 9/22 indicates that one or more children of one of the
>  default headings exists. The '*' indicates today. If one
>  double-clicks on
> a date, it would close all folds and fully open the fold for the date
> clicked on.
>
> I know I used the word 'easy' above. I think it might be if we got
> permission to use much of the calendar.vim code. We'd only need to
> change  the file edit routines.
>
> Thoughts?

KISS! and there`s a wheel invented already!

Recently I started using remind
(http://www.roaringpenguin.com/penguin/open_source_remind.php)
to manage my recurring and my timed events in my ONE BIG OUTLINE (tm).

The data format for remind is pure ascii, so it fits nicely in the vim
environment. The big plus: If I need a calendar for the next year
(or month or day) my calendar generator automagically fills in
everything remind already knows about. When I open today
remind just checks, if there is a deadline approaching and fills it in
without my help, what helps me a lot.

What I get looks like this:
        Oktober
                01.                               Sa 39
                        Merlin in Malente
                        Sanne nach Werne
                02.                               So 39
                        Merlin in Malente
                03.                               Mo 40
                        13:30 Merlin in Malente Abreise
                        Tag der Deutschen Einheit
                04.                               Di 40
                        Hartmut kommt
                        Herbstferien SH
                        Herbstferien NRW
                05.                               Mi 40
                        Hartmut kommt
                        Herbstferien SH
                        Herbstferien NRW
                06.                               Do 40
                        Hartmut kommt
                        R-2.2.0 release

For example the next holidays ("Herbstferien" in german) and "Tag der
Deutschen Einheit" were filled in when I fired up my calendar generator
for october, which by the way is ca 60 lines, because I borrowed all
knowledge about calendars (leap years etc.) from remind.

It boils down to:
Downside: use another external program (remind)
Upside: very, very flexible calendar in pure ascii, no need to worry
about vim programming.

Take a look an judge for yourself
Detlef




>
> Noel
>
> --
>
> ------------------------------------------------------------------
>   Noel Henson
>   www.noels-lab.com Chips, firmware and embedded systems
>   www.vimoutliner.org Work fast. Think well.
>
> _______________________________________________
> VimOutliner mailing list
> [hidden email]
> http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner


--
"Ceterum censeo Vodafone esse delendam!"
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: VO Calendar Enhancement

Noel Henson
In reply to this post by Stefan Schmiedl
On Wednesday 28 September 2005 12:23 pm, you wrote:

> yup ... store the following in mycal.vim
> ========== mycal.vim ==========
> function! MyCal(d,m,y,w,r)
>   let l:day = a:d<10 ? '0'.a:d : a:d
>   let l:month = a:m<10 ? '0'.a:m : a:m
>   let l:tag = a:y.'-'.l:month.'-'.l:day
>   wincmd l
>   execute "tag ".l:tag
>   normal! 3zozczOzz
> endfunction
> let calendar_action = 'MyCal'
> ========== mycal.vim ==========
>
> open a calendar buffer in vim
> in the calendar buffer type :source mycal.vim
> move cursor to interesting day in calendar buffer
> type <Return>

function! MyCal(d,m,y,w,r)
  let l:day = a:d<10 ? '0'.a:d : a:d
  let l:month = a:m<10 ? '0'.a:m : a:m
  let l:tag = '^\t*'.a:y.'-'.l:month.'-'.l:day
  wincmd l
  set foldlevel=0
  call search(l:tag)
  normal! 3zozczOzz
endfunction
let calendar_action = 'MyCal'

I made the small modification so I was not dependent upon a valid or
up-to-date tags file.

BTW, that rocks. How can we add the '+' indicators?

Noel

--

------------------------------------------------------------------
  Noel Henson
  www.noels-lab.com Chips, firmware and embedded systems
  www.vimoutliner.org Work fast. Think well.

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: VO Calendar Enhancement

Stefan Schmiedl
Noel Henson (28.09. 13:00):

> function! MyCal(d,m,y,w,r)
>   let l:day = a:d<10 ? '0'.a:d : a:d
>   let l:month = a:m<10 ? '0'.a:m : a:m
>   let l:tag = '^\t*'.a:y.'-'.l:month.'-'.l:day
>   wincmd l
>   set foldlevel=0
>   call search(l:tag)
>   normal! 3zozczOzz
> endfunction
> let calendar_action = 'MyCal'
>
> I made the small modification so I was not dependent upon a valid or
> up-to-date tags file.

that's cool. one thing less to worry about.

>
> BTW, that rocks. How can we add the '+' indicators?

Thinking about it, I'm not sure that I'd want them.
What good is a + besides 6 days out of 7?

s.

--
Stefan Schmiedl
+-------------------------------+----------------------------------------+
|Approximity GmbH               | EDV-Beratung Schmiedl                  |
|http://www.approximity.com     | Am Bräuweiher 4, 93499 Zandt, Germany  |
|mailto:[hidden email]  | Tel. (09944) 3068-98, Fax -97          |
+-------------------------------+----------------------------------------+
_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: VO Calendar Enhancement

Noel Henson
In reply to this post by Noel Henson
On Wednesday 28 September 2005 01:00 pm, you wrote:

> Noel Henson (28.09. 12:48):
> > How do I get the '+' indicator put on days that have child tasks
> > (under the default tasks?
>
> I didn't say that everything was easy, now, did I? :-)
>
> I have actually no idea, I stumbled upon the way of customizing
> the default calendar action while trying to find out how to use
> this calendar thingie.
>
> I took a cursory look at the source code only, and it looks quite
> complex to me ... there must be an easier way to display a normal
> calendar. And if we do it ourselves, using it won't be a problem.
>
> s.

Generating a calendar is quite an exercise. I have used calendar generation
as a way to learn a new programming language. I haven't done it in quite
some time. All we really need to do, I think, is add a hook (like the
calendar_action hook) into the routine that generates the '+'s.

Wait a minute..........

There is a hook. I'll be right back.

Noel




--

------------------------------------------------------------------
  Noel Henson
  www.noels-lab.com Chips, firmware and embedded systems
  www.vimoutliner.org Work fast. Think well.

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner
Reply | Threaded
Open this post in threaded view
|

Re: VO Calendar Enhancement

Noel Henson
In reply to this post by Stefan Schmiedl
On Wednesday 28 September 2005 01:30 pm, you wrote:
> Thinking about it, I'm not sure that I'd want them.
> What good is a + besides 6 days out of 7?
>
> s.

Excellent point. I just edited a sample calendar and it just makes it hard
to read the dates. So I'll withdraw the request.

Thanks!

Noel

PS: Now my working calendar works just like the screenshot I put up. :)

--

------------------------------------------------------------------
  Noel Henson
  www.noels-lab.com Chips, firmware and embedded systems
  www.vimoutliner.org Work fast. Think well.

_______________________________________________
VimOutliner mailing list
[hidden email]
http://www.lists.vimoutliner.org/mailman/listinfo/vimoutliner