Visual studio code comment in HTML files

2019-04-07 14:40发布

I am trying Visual Studio Code lately and i've noticed that when i try to add a line comment in an HTML file (using Ctrl+/ or Ctrl+K Ctrl+C) instead of this: <!-- -->, i get this {# #}.

In JS or CSS files the key bindings work just fine and produce the expected result.

So how can i get the proper type of comments in HTML files?

9条回答
冷血范
2楼-- · 2019-04-07 15:00

Try uninstalling any python extension packs you may have installed! You can then reinstall the python extension you need individually.

Chances are one of the extensions in the bundle of that extension pack is causing the issue

查看更多
小情绪 Triste *
3楼-- · 2019-04-07 15:08

In your Visual Studio Code windows, go to File->Preferences->Keyboard Shortcut

This will open two files beside each other like in the screenshot below:

enter image description here

here you can change or create your own shortcuts. Like I just replaced Ctrl+KU to Ctrl+/

Hope this will work for you !!

查看更多
劫难
4楼-- · 2019-04-07 15:15

Finally i found what the problem was. I had installed the twig plugin (for the Twig php template engine) and that was causing the comments issue.

查看更多
登录 后发表回答