Associate file extensions to language in Notepad++

Software:
Notepad++ 7.8.6

If your writing code in languages that are based on a common language but their files names have an uncommon extension, for example, the 3D shading languages OSL, and HLSL, which are written in C syntax but have .osl and .hlsl, or .fx as file name extensions,
Notepad++ wont automatically recognize that the code in these files is actually C language and present their syntax properly.

To set Notepad++ to recognize specific file associations with a wanted language:

  1. Goto:
    Settings > Style Configurator:
    Annotation 2020-06-18 132154
  2. In the Style Configurator window:
    Select the wanted language in the language list on the left,
    And in the User ext. field, type a list of file extensions separated by spaces:
    These file extensions will be interpreted as the selected language.
    Annotation 2020-06-18 132359

 

Related:
Setup a GitHub to associate file extension with a  language
Display tabs in Notepad++