Loading ...
Sorry, an error occurred while loading the content.

Re: syntaxhighlighting by parsing header-files?

Expand Messages
  • Vadim Zeitlin
    ... This is going to be very difficult to do, I m afraid. OTOH, what about using tags file for syntax highlighting? Like this you leave ctags to do the
    Message 1 of 2 , Apr 2, 2001
    • 0 Attachment
      On 02 Apr 2001 14:13:49 +0000 Bart Kuik <kuik@...> wrote:

      > better made a script for it, or maybe an automated script that sees the
      > line "#include <gtk/gtk.h>", executes "gtk-config --libs --cflags" to
      > see where the headers are, and automatically parses them for
      > syntax-highlighting.

      This is going to be very difficult to do, I'm afraid. OTOH, what about using
      tags file for syntax highlighting? Like this you leave ctags to do the
      difficult part of the work (parsing C - which it does amazingly well, BTW) and
      you should be able easily to create syntax groups for various tags (i.e.
      functions, structs/classes, ...) from the tags file.

      I didn't do it myself though (but I'd like to have something like this ;-).

      Regards,
      VZ
    • Bart Kuik
      Hi all, A couple of days ago I started programming in GTK+, just to get some experience with working with an API, and to fix bugs / create apps just for fun
      Message 2 of 2 , Apr 2, 2001
      • 0 Attachment
        Hi all,

        A couple of days ago I started programming in GTK+, just to get some
        experience with working with an API, and to fix bugs / create apps just
        for fun and to contribute to the Gnome / opensource community. But as
        far as I know, Vim does not have native syntax-hilighting for Gtk+, and
        I couldn't find any vim-scripts that did the job. So I started to make a
        messy vim-script that supported all the keywords I already used (I am
        already in chapter 8 of the tutorial on gtk.org), and I made a script
        for the gtkenums.h header. Most of the work for that was just
        straight-forward copy/paste that was so simple and boring that I'd
        better made a script for it, or maybe an automated script that sees the
        line "#include <gtk/gtk.h>", executes "gtk-config --libs --cflags" to
        see where the headers are, and automatically parses them for
        syntax-highlighting.

        Does anyone know if something like this already exists, or how difficult
        it is to write a script for it? I haven't got much experience with
        string-parsing and Vim's own scripting-language since I'm only a
        beginner and gtk+ is my first attempt to do something with my
        basic-knowledge of C. But especially if there's one good script for it
        (or maybe built-in in a next version of Vim) it just needs a few extra
        lines for each library in the c.vim syntax-script to give full
        syntax-highlighting......

        Bart

        Ow yeah, and an example of how gtk+ apps look in my gvim is here:
        http://www.rendo.dekooi.nl/~kuik/vim/rangewidgets.c.html
        (it's one of the example-sources in the gtk+ tutorial)
      Your message has been successfully submitted and would be delivered to recipients shortly.