xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.95k stars 308 forks source link

Question about clang_user_options #551

Closed stefanos82 closed 1 year ago

stefanos82 commented 6 years ago

I'm currently using the following format to include multiple directories for header files' lookup.

let g:clang_user_options = '-I/usr/include/'
let g:clang_user_options .= ' -I/usr/include/boost/'
let g:clang_user_options .= ' -I/usr/include/x86_64-linux-gnu/'
let g:clang_user_options .= ' -I/usr/include/c++/7/'
let g:clang_user_options .= ' -I/usr/lib/gcc/x86_64-linux-gnu/7/include/'
let g:clang_user_options .= ' -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/'

This is just a normal size, but since there's no simpler way to recursively look for sub-directories within /usr/include and other standard directories, this could get quite bloated with concatenated let g:clang_user_options .= <...>.

Is it difficult to implement the following format?

let g:clang_user_options = [
    '-I/usr/include/',
    '-I/usr/include/boost/',
    '-I/usr/include/x86_64-linux-gnu/',
    '-I/usr/include/c++/7/',
    '-I/usr/lib/gcc/x86_64-linux-gnu/7/include/',
    '-I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/',
]

At least this way it would be a lot easier to add a newly inserted line right inside this list without all this unnecessary repetition.