12

While writing a comment in .ini files, VS Code gives me the comment ; when what I need is a #. Is there a setting somewhere where I can replace that character?

This is similar issue but not a duplicate of the following post, as I am not editing assembly and the extension provided does not work: How to customize comment character in Visual Studio Code?

3 Answers3

4

The easiest way around this I've found is to associate .ini files with Shell Script instead of Ini - then you can toggle comments using '#'.

Do Ctrl+Shift+P, Change Language Mode, then Configure File Association for '.ini', and select Shell Script.

2

As noted here, change the language mode to Properties rather than Ini. Look in the status bar to see whether the language is "Ini" (lineComment ;) or "Properties" (lineComment #).

1
  1. the ; for [ini] and the # for [properties] seems to be just as expected, as the existed answer says
  2. seems that the lineComment char not works properly in some version of vscode ... I tested the v1.84.1 on flatpak and v1.84.2 on windows is fine ~
  3. if still not work, just try the extension ArturoDent.custom-language-syntax
laoyb
  • 31