I'm using vim
on ubuntu 16.04
platform, I found the Youcompleteme
plugin always automatically add some unnecessary header file.
A simple example like I use libtorch
, the torch/torch.h
header file contains all headers the package needed, and don't need specifying any other related header. Just like the pictures below:
The completion works well, but after I use space select the completion, the unwanted header torch/nn/module.h>
was added automatically.
I want to get a configure to disable automatically adding header files like this.
Any reply will be appreciated!
In C program should necessarily contain the header file which stands for standard input and output used to take input with the help of scanf() and printf() function respectively.
In the C and C++ programming languages, a header file is a file whose text may be automatically included in another source file by the C preprocessor by the use of a preprocessor directive in the source file.
< Vim. YouCompleteMe (shortened as YCM) is a code-completion engine for Vim. It supports the following languages: C/C++/Objective-C/Objective-C++ Python.
I stumbled upon this problem when I switched from libclang based YCM to clangd based. The guys on the community chat helped to figure out the solution: you can add the following line into your ~/.vimrc file:
let g:ycm_clangd_args=['--header-insertion=never']
Read :help g:ycm_clangd_args
and ./clangd --help-list
for details on these options. It turns out there are plenty of cool configuration tweaks for clangd.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With