VO Math Package

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

VO Math Package

Noel Henson
Everyone,

Here is a simple script that adds outline-aware math to VO. I've also
included a test outline.

To use it, just so vo_math.vim.

Once you're done editing, use <localleader>= to compute the document.

I know it's still a bit rough, but let me know how it works.

One more thing, when entering a new formula, be sure to include a 0 at the
end of the line so vo_math knows where to put the result. Eg.

{5+3}= 0

Have fun!

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

math.otl (807 bytes) Download Attachment
vo_math.vim (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VO Math Package

Noel Henson
One more little thing. You will be limited to simple integer math if you
are not running 7.2.8 or higher. I'm running 7.2.9 and it works great!

Noel

On Monday 20 October 2008, Noel Henson wrote:

> Everyone,
>
> Here is a simple script that adds outline-aware math to VO. I've also
> included a test outline.
>
> To use it, just so vo_math.vim.
>
> Once you're done editing, use <localleader>= to compute the document.
>
> I know it's still a bit rough, but let me know how it works.
>
> One more thing, when entering a new formula, be sure to include a 0 at
> the end of the line so vo_math knows where to put the result. Eg.
>
> {5+3}= 0
>
> Have fun!
>
> 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 Math Package

Scott Scriven-2
In reply to this post by Noel Henson
* Noel Henson <[hidden email]> wrote:
> Here is a simple script that adds outline-aware math to VO.

Neat!

> I've also included a test outline.

Thanks, this really helps explain things.

Is there any sort of "count" operation, to list the number of
immediate child nodes?  Or a way to have more than one
calculation per line?

This is just an idea, but something like...

    Days worked: {SUM} days= 123 {SUM} hours= 984
        October: {COUNT} days= 12 {SUM} hours= 96
            21: 09:00-17:00 (hours= 8)
            18: 10:00-17:30 (hours= 7.5)
            17: 09:30-17:45 (hours= 8.25)
            ...
        September: ...

Or, something else I'd find useful is a count of children with
[_]s, and children with [X]s...  or more generally, perhaps the
number of children with a given string.  But that may be overkill
in VO; I hardly even use % in checklist parents any more.  It
seems like a feature more suited to TreeLine.


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

Re: VO Math Package

Noel Henson
On Tuesday 21 October 2008, Scott Scriven wrote:

> * Noel Henson <[hidden email]> wrote:
> > Here is a simple script that adds outline-aware math to VO.
>
> Neat!
>
> > I've also included a test outline.
>
> Thanks, this really helps explain things.
>
> Is there any sort of "count" operation, to list the number of
> immediate child nodes?  Or a way to have more than one
> calculation per line?

There is no way to count child nodes. I'll think about that. We do count
child nodes/branches in checkboxes to compute percentages.

Currently there is only one formula per heading. Having more that one would
increase the complexities of finding where to put results and assigning
variable names dramatically.

>
> This is just an idea, but something like...
>
>     Days worked: {SUM} days= 123 {SUM} hours= 984
>         October: {COUNT} days= 12 {SUM} hours= 96
>             21: 09:00-17:00 (hours= 8)
>             18: 10:00-17:30 (hours= 7.5)
>             17: 09:30-17:45 (hours= 8.25)
>             ...
>         September: ...

You could do this:
     Days worked: {hours/8} days= 123
         October: {hours} hours= 96
             21: 09:00-17:00 (hours= 8)
             18: 10:00-17:30 (hours= 7.5)
             17: 09:30-17:45 (hours= 8.25)
             ...
         September: ...

> Or, something else I'd find useful is a count of children with
> [_]s, and children with [X]s...  or more generally, perhaps the
> number of children with a given string.  But that may be overkill
> in VO; I hardly even use % in checklist parents any more.  It
> seems like a feature more suited to TreeLine.

To each his own. :)

You have access to routines in vo_checkboxes.vim to count the number of
children. That's how the percentages are computed. If you don't have the
exact routine you want, you could use what's there as a examples.

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

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 Math Package

Scott Scriven-2
* Noel Henson <[hidden email]> wrote:
> Currently there is only one formula per heading. Having more
> that one would increase the complexities ...

Yeah, I figured it would be a major pain, but I thought I'd ask
in case I was wrong.  :)

The time sheet was just an example anyway.  While I do tend to
use vim for tracking time on projects, I don't really expect VO
to do all the calculations for me.  I'll probably make a small
python add-on to handle some of that, eventually.  But it's less
about making time tracking easier and more about learning
vim-python.


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