5

So I have a very basic C program to try and test clang_complete:

#include <stdio.h>
#include <stdlib.h>

struct xampl {
  int x;
};

int main()
{
  struct xampl structure;
  struct xampl *ptr1;
}

However, every time I try to do structure. or ptr1->, the program gives me the error:

User defined completion (^U^N^P) Pattern not found.

I tried adding this to my vimrc:

let g:clang_user_options='|| exit 0' -- 

(from this thread) but, the completion still doesn't work.

Is there something I am missing or not understanding here?

Community
  • 1
  • 1
Dasun
  • 83
  • 1
  • 9

1 Answers1

1

When you say ptr-> you mean ptr1-> right? I have only two strings in my .vimrc

let g:clang_complete_copen=1
let g:clang_hl_errors=1

and your example works fine for me. Make sure you have .clang_complete file with valid include paths (see :help clang_complete for example file). Try to debug clang completer by set up variable let g:clang_debug=1. And read this thread maybe it help you.

Community
  • 1
  • 1
Alex Kroll
  • 481
  • 5
  • 15
  • Sorry I did mean, ptr1. I don't have a .clang_complete file in my vim directory, and the FAQ is very vague on how to fix the pattern not found issue. Where should I put/create the .clang_complete file? Thanks – Dasun Jan 06 '13 at 21:02
  • I solved the problem. Didn't know you had install clang for it to work. Thanks for the thread link! – Dasun Jan 07 '13 at 01:58