1

I'm new to vim and I'm trying to get code completion to work. I'm using clang_complete and vim-cmake-project. I open my project by typing :CMake projectdirectory It opens my project and I can select which file I want to open but when I try to trigger clang_complete it says, -- User defined completion (^U^N^P) Pattern not found. I added this to my .vimrc file:

let g:clang_complete_auto = 1
let g:clang_use_library = 1
let g:clang_debug = 1
let g:clang_library_path = '/usr/lib/'
let g:clang_user_options='|| exit 0'

However, I still get the same error. Also I have clang and libclang-dev packages installed. So what else can I do to get clang_complete to work?

timss
  • 9,982
  • 4
  • 34
  • 56
Steve Butcher
  • 91
  • 1
  • 2
  • 9
  • Related question: [clang_complete in VIM](http://stackoverflow.com/q/10259485). – glts Jun 01 '13 at 12:01
  • Yeah, actually added the path because I read that thread. I have everything they said I would need except I have +python and +python3 but they don't have /dyn. I don't know if that changes anything? What does the /dyn mean and how do I get it? – Steve Butcher Jun 01 '13 at 18:35
  • Do you have clang and llvm installed properly? – GWW Jun 01 '13 at 19:27
  • Possible duplicate: [clang complete doesn't work](http://stackoverflow.com/questions/10901129/clang-complete-doesnt-work) – timss Jun 01 '13 at 22:51
  • @timss Where do you think I got "let g:clang_user_options='|| exit 0'" from? That thread! It does not help. – Steve Butcher Jun 01 '13 at 23:35
  • I can create a helloworld project and code completion works fine. This error only happens when I try to open my large project. – Steve Butcher Jun 02 '13 at 00:06
  • @SteveButcher No need to be upset about it.. Also, are you sure your code is correct? I can't remember correctly, but I believe you might encounter such an error if there's a problem in your code. – timss Jun 02 '13 at 12:42

2 Answers2

1

Pressing ctrl+X will force it to complete which appears to work fine. Still not sure why it happens. I suspect you have to create a .clang_complete file but I never could get the python script to work.

Steve Butcher
  • 91
  • 1
  • 2
  • 9
0

My configure as follow: 1) .vimrc add: let g:clang_user_options='|| exit 0'

2) add .clang_complete code browser directory eg. -I../mylib/include

When appear "-- User defined completion (^U^N^P) Pattern not found", I find that i miss add some include dirs to .clang_complete.

jim ying
  • 361
  • 4
  • 17