💾 Archived View for bbs.geminispace.org › u › jeang3nie › 3955 captured on 2023-11-14 at 10:16:44. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

➡️ Next capture (2023-12-28)

🚧 View Differences

-=-=-=-=-=-=-

Comment by 🦀 jeang3nie

Re: "I want to have completion for my custom C language headers,..."

In: s/vim

Are you on original Vim? I'm using NeoVim and the nvim-cmp plugin does exactly what you're asking, but it's written in Lua specifically for NeoVim.

🦀 jeang3nie

Aug 08 · 3 months ago

8 Later Comments ↓

🚀 stack · Aug 08 at 14:59:

@jeang3nie: do you know if original vim's new Lua support is compatible with NeoVim's Lua? I've been avoiding NeoVim after my Common Lisp bindings uncovered many issues in display protocols and maintainers were saying really idiotic argumentative stuff...

🐝 Addison · Aug 08 at 19:45:

YouCompleteMe can do this

🌲 Odintsoff · Aug 09 at 00:20:

@jeang3nie Original Vim. Thinking about moving to neovim though.

🌲 Odintsoff · Aug 09 at 00:21:

@Addison I also tried using YCM, but no success to make it read my own header files. Maybe conflicting with CoC.

🐦 Arkaeriit · Aug 10 at 18:35:

@Addison How can one do this with YCM?

🐝 Addison · Aug 10 at 18:51:

@Arkaeriit I'm assuming that @Odintsoff is asking about code-completion for things declared in headers.

I only know how to do this with CMake, so YMMV but I know that YCM has other ways of configuring this.

If in your CMakeLists.txt you enable CMAKE_EXPORT_COMPILE_COMMANDS, CMake will create a file called compile_commands.json in your build directory. If you copy that JSON file to the root of your source tree, YCM will read the flags it contains and use them for completions.

So if my CMake config contains something like

include_directories(./include)

then compile_commands.json will contain

-I./include ...

And YCM will provide completions for that header.

🐦 Arkaeriit · Aug 11 at 18:08:

@Addison Thanks for the tip. It will be a good starting point.

🌲 Odintsoff · Aug 22 at 00:09:

Thanks all! I will try the tips provided and give some feedback. Thanks again!

Original Post

🌒 s/vim

I want to have completion for my custom C language headers, but I cannot see how to add it. I use CoC and it does help with the language headers, but not the ones in my project folder. How can I add them?

💬 Odintsoff · 9 comments · Aug 07 · 3 months ago