axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Vim syntax file


From: Fabio S.
Subject: Re: [Axiom-developer] Vim syntax file
Date: Mon, 11 Nov 2013 17:53:42 +0100 (CET)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)

I have only one remark: I used axiom to generate
categories/domains/packages/operators names. Are them exactly the same
in fricas? I don't know this. From this point of view, maybe they can't
be completely interchangeable.

If I were you, I would simply write a little script that a user could
run on his/her machine and generated the respective lists of
categories/domains/... in a form appropriate for the vim-mode.

That's a good idea. Done by hand, the procedure is quite simple:

1)      In axiom:
        )set output length  20
        )spool cat.vim
        )what cat
        )spool
        )spool dom.vim
        )what dom
        )spool
        )spool op.vim
        )what op
        )spool
        )spool pack.vim
        )what pack
        )spool

2)      clean up top and bottom of every file

3)      Insert vim syntax:

        sed  "s/\(^[a-zA-Z].*$\)/syn keyword axCategories \1/" cat.vim > 
categories.vim
        sed  "s/\(^[a-zA-Z].*$\)/syn keyword axDomain \1/" dom.vim > domains.vim
        sed  "s/\(^[a-zA-Z].*$\)/syn keyword axPackages \1/" pack.vim > 
packages.vim
        sed  "s/\(^[a-zA-Z].*$\)/syn keyword axOperation \1/" op.vim | sed "s/\(^[^s].*$\)/syn 
match axOperation \"\\\\M\1\\\\m\"/"  > operations.vim

Step 3 is  already shell script.
Step 2 can be done if one assumes that the "garbage" in the spool is always the same: but is this true for all forks of axiom? I don't know.
Maybe in this step you still need to edit files by hand, at least to check
them.
And what about step 1? How can I start axiom with a input file in a shell
script?

Fabio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]