I forgot to mention that you have to build your tags database with
this command :
ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .
You'll see more details on these parameters in the help file.
Moreover, there is a recent bug where you have to disable the
ignorecase function to complete correctly your code (eg: A* a), it
will be fixed.
Best regards,
Vissale
2007/2/20, Bill McCarthy <[EMAIL PROTECTED]>:
On Mon 19-Feb-07 6:14am -0600, Vissale NEANG wrote:
> To use cpp completion with c files you can copy
> ~/.vim/after/ftplugin/cpp.vim to ~/.vim/after/ftplugin/c.vim
This apparently doesn't work with C. I've installed it and
copied cpp.vim to c.vim as instructed above.
It automatically goes into omni mode when I type the '>' in:
b->
However it reports "Pattern not found" - yes I created the
tags file. I tried again with each function parameter on a
separate line - that didn't matter to your function, but
worked perfectly after deleting after/ftplugin/c.vim
If anyone else wants to see this happen, here is a complete,
albeit trivial, program (try to omni complete a line of C
code starting with b-> in the function myfunc():
#include <stdio.h>
#include <stdlib.h>
typedef struct A
{
int a1;
int a2;
int a3;
} A;
typedef struct B
{
int b1;
int b2;
int b3;
} B;
void myfunc( A *a, B *b );
int main( void )
{
A x;
B y;
myfunc( &x, &y );
printf( "%d %d %d\n", x.a1, x.a2, x.a3 );
printf( "%d %d %d\n", y.b1, y.b2, y.b3 );
return EXIT_SUCCESS;
}
void myfunc( A *a, B *b )
{
a->a1 = 1;
a->a2 = 2;
a->a3 = 3;
b->b1 = 4;
b->b2 = 5;
b->b3 = 6;
}
--
Best regards,
Bill