"./vimXX/src/syntax.c" as an external utility?

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

"./vimXX/src/syntax.c" as an external utility?

Guido van Steen

Dear VIM developers,

I would like to use VIM's syntax/lexical highlighting/coloring in order to color the command line in zsh - and if possible highlight it as well. (For zsh: see "www.zsh.org"). I would actually hope that this can be done using VIM's zsh' syntax file ("./vimXX/syntax/zsh.vim")

It seems to me that within VIM the actual VIM syntax/lexical highlighting/coloring has been programmed in the file "./vimXX/src/syntax.c".

Unfortunately, however, I am not any good at C programming. Therefore most of this "syntax.c" file seems like magic to me.

My question is: Could someone give me some idea on how this "syntax.c" file could be turned into into an external program, which takes a "zsh file" as its input, and which provides the information on the syntax/lexical highlighting/coloring of this "zsh file" as its output??

Does someone know if such an external program has ever been made?

Thanks a lot!

Guido


      New Email names for you!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
a/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: "./vimXX/src/syntax.c" as an external utility?

iler.ml

On Sun, Oct 11, 2009 at 00:46, Guido van Steen <[hidden email]> wrote:

>
> Dear VIM developers,
>
> I would like to use VIM's syntax/lexical highlighting/coloring in order to color the command line in zsh - and if possible highlight it as well. (For zsh: see "www.zsh.org"). I would actually hope that this can be done using VIM's zsh' syntax file ("./vimXX/syntax/zsh.vim")
>
> It seems to me that within VIM the actual VIM syntax/lexical highlighting/coloring has been programmed in the file "./vimXX/src/syntax.c".
>
> Unfortunately, however, I am not any good at C programming. Therefore most of this "syntax.c" file seems like magic to me.
>
> My question is: Could someone give me some idea on how this "syntax.c" file could be turned into into an external program, which takes a "zsh file" as its input, and which provides the information on the syntax/lexical highlighting/coloring of this "zsh file" as its output??
>
> Does someone know if such an external program has ever been made?

Yes. Probably you'll want to use vim in batch mode, along the lines of

   vim -c 'set ft=zsh|syntax on' -c 'TOhtml' -c 'w!
/path/to/output.html' -c 'qall!' input_file

This line seems to actually work :-)  Ask on "vim_use" forum for
further details (*1).
And see :help convert-to-HTML

If you wrap this line into shell script, you get the "external utility".

Yakov

(1) http://groups.google.com/group/vim_use

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: "./vimXX/src/syntax.c" as an external utility?

Nikolai Weibull-11
In reply to this post by Guido van Steen

On Sun, Oct 11, 2009 at 00:46, Guido van Steen <[hidden email]> wrote:

> My question is: Could someone give me some idea on how this "syntax.c" file could be turned into into an external program, which takes a "zsh file" as its input, and which provides the information on the syntax/lexical highlighting/coloring of this "zsh file" as its output??

It would be a lot simpler to just write some Zsh code for this.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: "./vimXX/src/syntax.c" as an external utility?

Guido van Steen
In reply to this post by iler.ml

Hi Yakov,

Thanks a lot! I did not know that VIM could be run in batch
mode. That is a good feature to know about anyway!

I just tried it out but unfortunately (on my laptop) it takes
about 150 miliseconds to process a simple command. So I am
afraid this will not be usable for on-the-fly syntax/lexical
highlighting/coloring coloring.

I think I will have to write something quicker.

Guido

--- On Sun, 11/10/09, Yakov Lerner <[hidden email]> wrote:

> From: Yakov Lerner <[hidden email]>
> Subject: Re: "./vimXX/src/syntax.c" as an external utility?
> To: [hidden email]
> Date: Sunday, 11 October, 2009, 5:17 PM
>
> On Sun, Oct 11, 2009 at 00:46, Guido van Steen <[hidden email]>
> wrote:
> >
> > Dear VIM developers,
> >
> > I would like to use VIM's syntax/lexical
> highlighting/coloring in order to color the command line in
> zsh - and if possible highlight it as well. (For zsh: see
> "www.zsh.org"). I would actually hope that this can be done
> using VIM's zsh' syntax file ("./vimXX/syntax/zsh.vim")
> >
> > It seems to me that within VIM the actual VIM
> syntax/lexical highlighting/coloring has been programmed in
> the file "./vimXX/src/syntax.c".
> >
> > Unfortunately, however, I am not any good at C
> programming. Therefore most of this "syntax.c" file seems
> like magic to me.
> >
> > My question is: Could someone give me some idea on how
> this "syntax.c" file could be turned into into an external
> program, which takes a "zsh file" as its input, and which
> provides the information on the syntax/lexical
> highlighting/coloring of this "zsh file" as its output??
> >
> > Does someone know if such an external program has ever
> been made?
>
> Yes. Probably you'll want to use vim in batch mode, along
> the lines of
>
>    vim -c 'set ft=zsh|syntax on' -c 'TOhtml'
> -c 'w!
> /path/to/output.html' -c 'qall!' input_file
>
> This line seems to actually work :-)  Ask on "vim_use"
> forum for
> further details (*1).
> And see :help convert-to-HTML
>
> If you wrap this line into shell script, you get the
> "external utility".
>
> Yakov
>
> (1) http://groups.google.com/group/vim_use
>
> >
>


      Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: "./vimXX/src/syntax.c" as an external utility?

Guido van Steen
In reply to this post by Nikolai Weibull-11

Hi Nikolai,

Thanks for your advice. I am not sure though if writing a zsh
script will be much simpler for me. My problem is that I am
unfamiliar with VIM's syntax files.

For this reason I thought that I might be able to use
VIM which provides syntax/lexical coloring/highlighting
already.

Best wishes,

Guido

--- On Sun, 11/10/09, Nikolai Weibull <[hidden email]> wrote:

> From: Nikolai Weibull <[hidden email]>
> Subject: Re: "./vimXX/src/syntax.c" as an external utility?
> To: [hidden email]
[snip]
> It would be a lot simpler to just write some Zsh code for
> this.



      New Email names for you!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
a/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---