Namelist syntax highlighting in Notepad++

I’ve created a configuration file for namelist syntax highlighting in Notepad++.

The file can be downloaded at the following link: Fortran namelist configuration file for Notepad++ · GitHub

To add the configuration file follow the menus Language → User Defined Language → Define your language which will bring up a dialog box. Press Import and provide the .xml configuration file. Alternatively you can open the dialog box by pressing on the “lightning bolt” tool marked in the image below.

Here’s an example of what it looks like in action:

There are a few rough edges as the concepts of the Notepad++ User Defined Language System do not map exactly over to Fortran concepts. Some problems I’ve observed

  • decimal numbers with a trailing dot such as 1. or 42. are not picked up
  • I couldn’t find a way to make individual namelists (that is the section between & and the slash (/) character) foldable; this would be useful if many namelists are placed in the same file

If you identify any further issues please post them here.

3 Likes