How to change toggle comment from @REM to REM in VS Code

Viewed 640

In VS code, when I toggle a comment, using Ctrl+/, it comments the line with @REM. How do I change this to comment the line with just REM?

2 Answers

In the \resources\app\extensions\bat folder of your VSCode installation folder, there's a file called language-configuration.json. At the very beginning of the file, there's a bit that reads

{"comments":{"lineComment":"@REM"}

Change this to

{"comments":{"lineComment":"REM"}

(Note that if VSCode ever updates, you'll have to change this file again.)

Have a look at this extension, Custom Language Properties, that I just released. Here it is doing what you want for .bat batch file lineComments:

Custom language properties extension demo on a batch file

It makes changing comments or brackets for a language or languages pretty easy. Via a setting like:

  "custom-language-properties": {

    "bat.comments.lineComment": "REM",
    "python.comments.lineComment": "# ~",
    "javascript.comments.blockComment": ["/*  ","  */"]
 }
Related