Visual Studio Code syntax highlighting for CMakeLists.txt
Asked Answered
P

2

16

I am using ROS and C++ and ROS packages have a CMakeLists.txt in them. I would like to have a syntax highlighting for CMakeLists.txt in visual studio code.

Unfortunately, I searched on the internet but I can't find how to do this.

Could you help me?

Primer answered 30/4, 2019 at 11:43 Comment(2)
Are you referring to syntax highlighting? If so, you might be looking for this.Requital
Yeah, I found it immeditately after posting my question :)Primer
P
45

Below is how to do it. It is quite straightforward (with an extension):

  1. Open Visual Studio Code
  2. CTRL+P - Launch VS Code Quick Open
  3. ext install twxs.cmake - Install the extension "CMake For VisualStudio Code"

I hope this will help someone else.

p.s. It is always like that. I search for a long time, I don't find an answer. Then I post the question here and I immediately find the answer.

Primer answered 30/4, 2019 at 11:59 Comment(1)
I wonder why Microsoft has a whole CMake tools extension that doesn't highlight the text... Who is twxs anyways?Suburbia
A
0

most easiest is to install cmake and CMake Language Support extensions. makes your life easier. you could search them and install in extension panel in vs code.

Anticoagulant answered 1/9, 2022 at 9:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.