visual-studio-2015pugpugjs

Jade like syntax highlighting of .pug files Visual Studio 2015


This maybe a really silly question, but I've can't find any option to make it work.

Following the recent change of the npm package name from jade to pug, i've gone around and changed all the .jade files in my projects to .pug - as the package demands.

This has caused a niggling issue - the jade syntax is not highlighted in .pug files. What is more, I can't find the option to add jade editing experience to .pug extension files in VS15.

enter image description here

Anyone worked out how to make it work?


Solution

  • Right-click on the .pug file in Solution Explorer, select "Open With", then choose the Jade editor.

    Also, if you want your indentation in .pug/.jade files to be 2 spaces instead of 4 to match the Pug documentation and examples, you can go to Tools > Options > Text Editor > Jade > Tabs, and then set "Tab size" and "Indent size" to 2.