I have recently been working on a web project and I would like my css files to recognize the classes and ids from the html files. Is there any way to make this work?

Edit: So I use coc.nvim. By recognize I mean that I want like the variables and functions to be applicable(i.e auto completed) in the other files as well.

  • 2
    What do you mean by recognise? What does Vim currently do and how do you want it to behave differently?
    – Rich
    May 31, 2021 at 10:08
  • 1
    To add to Rich question: I assume you mean for completion so you should also tell use if you use any tool to do the job (coc, ymc, etc...)
    – statox
    May 31, 2021 at 10:57
  • Welcome to Vi and Vim! As mentioned before, please add more context to your question. Please edit it to tell us more about what you're trying to solve. Thanks!
    – filbranden
    May 31, 2021 at 14:39
  • Have edited the question. So basically as I mentioned, I want coc.nvim to like recognize the class names from the html file when I am in the css file. Something like what vs code does.
    – Zawedcvg
    Jun 1, 2021 at 6:20

1 Answer 1


I am assuming you are looking for this plugin - https://github.com/yaegassy/coc-html-css-support

This plugin recognizes the css file from the current workspace and provide them as a completion in your html file (or any other file you specify - https://github.com/yaegassy/coc-html-css-support#add-other-html-like-languages-example)

  • 3
    Welcome to Vi and Vim! This answer would benefit greatly from an explanation of what the plugin is and how you think it will answer the question. Please edit to improve the answer.
    – D. Ben Knoble
    Aug 16, 2021 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.