Text editors or IDEs with folding of Fortran include statements

Is anyone aware of a text editor which supports folding of Fortran include statements?

1 Like

Not specifically but in Notepad++ you can change the language file and define fold tokens.

1 Like

In Visual studio + Intel OneAPI you may set the two options in outline as true. The code can be folded. See below. But statements perhaps cannot be folded.

It would be nice to have an editor aware of Fortran include syntax. If using include files as a method of “poor man’s templates”, I find it tiring to have to switch between the procedure declaration in a module, and the implementation in an include file:

module foo
   implicit none
   integer, parameter :: sp = kind(1.0)
   integer, parameter :: dp = kind(1.0d0)
contains
   subroutine bar_sp(a, b, c)
      integer, parameter :: wp = sp
      real(wp), intent(inout) :: a(:), b(:), c(:)
      include 'bar.inc'
   end subroutine
   subroutine bar_dp(a, b, c)
      integer, parameter :: wp = dp
      real(wp), intent(inout) :: a(:), b(:), c(:)
      include 'bar.inc'
   end subroutine
end module

Currently I get by with a multi-column editor layout, or in the worst case switching from file to file.
What I’d like to have is a window with a text buffer, that sourced the content from multiple files (multiple “views”).