Connecting Tech Pros Worldwide Forums | Help | Site Map

Getting vim to recognize objects?

japh
Guest
 
Posts: n/a
#1: Jul 23 '05
Vim is swell about turning standard varbiable types green - like:

int myAge;
double myIQ;

or whatnot.

But if I have a class Point and declare a Point:
Point upperLeftCorner;
Point lowerRightCorner;

instead of high-lighting the word Point, it shows up white like any
other word.

Any setting in vim to get it to recognize declared class types ?

Thanks


Siemel Naran
Guest
 
Posts: n/a
#2: Jul 23 '05

re: Getting vim to recognize objects?


"japh" <japh@eudoramail.com> wrote in message
[color=blue]
> Vim is swell about turning standard varbiable types green - like:
> But if I have a class Point and declare a Point:
> Point upperLeftCorner;[/color]

You can type

:syn keyword cType Point

This will color "Point" in green.


But what if you have this

namespace Math { class Point { }; }

int main() {
Math::Point Point;
}

Here you want the Math::Point to show up in green, but only both Point will
show up in green.



japh
Guest
 
Posts: n/a
#3: Jul 23 '05

re: Getting vim to recognize objects?


thanks. i was hoping there was a way vim could do this dynamically so I
don't have to type in each class name, but it is good to know this
option is there.

thanks again

Jon Wilson
Guest
 
Posts: n/a
#4: Jul 23 '05

re: Getting vim to recognize objects?


japh wrote:[color=blue]
> Vim is swell about turning standard varbiable types green - like:
>
> int myAge;
> double myIQ;
>
> or whatnot.
>
> But if I have a class Point and declare a Point:
> Point upperLeftCorner;
> Point lowerRightCorner;
>
> instead of high-lighting the word Point, it shows up white like any
> other word.
>
> Any setting in vim to get it to recognize declared class types ?
>
> Thanks
>[/color]


I have found the tips on vim's homepage to be exceedingly helpful. You
could try looking through them.

Here is vim's page's URL:

http://www.vim.org/

and the tip page:

http://www.vim.org/tips/index.php

Regards,
Jon
japh
Guest
 
Posts: n/a
#5: Jul 23 '05

re: Getting vim to recognize objects?


thanks - this looks like a really usefull resource.

Closed Thread