Search code examples
visual-studio-codeidenotepad++syntax-highlighting

Is it possible to apply syntax highlighting of one filetype to another in Visual Studio Code, like in Notepad++?


Somebody who used Notepad++ clearly knows about applying custom syntax highlighting to any text, by selecting an option from the "Language" menu, as shown the screenshot below;

screenshot

This way, one can highlight the text, as he wish. I would like to know, is there any similar mechanism in Visual Studio Code editor, so that I can manually highlight the text even if its not done automatically.

Thanks.


Solution

  • You can change the Language used for a particular instance by clicking on the Language ID field in the Status bar and select the new language from the list.

    This executes the command workbench.action.editor.changeLanguageMode or Change Language Mode from the Command palette.

    To do a permanent Language ID selection based on the file extension define a setting

      "files.associations": {
        "*.myext": "html",
        "*.myfoo": "css"
      }