# Text editors or IDEs with folding of Fortran include statements

**URL:** <https://fortran-lang.discourse.group/t/text-editors-or-ides-with-folding-of-fortran-include-statements/2779>\
**Category:** Uncategorized\
**Created:** [February 13, 2022, 2:34pm UTC](https://fortran-lang.discourse.group/t/text-editors-or-ides-with-folding-of-fortran-include-statements/2779 "2022-02-13T14:34:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [February 13, 2022, 2:34pm UTC](https://fortran-lang.discourse.group/t/text-editors-or-ides-with-folding-of-fortran-include-statements/2779/1 "2022-02-13T14:34:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andrew\_4619](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@andrew\_4619](https://fortran-lang.discourse.group/u/andrew_4619)\
**Post date:** [February 13, 2022, 5:43pm UTC](https://fortran-lang.discourse.group/t/text-editors-or-ides-with-folding-of-fortran-include-statements/2779/2 "2022-02-13T17:43:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CRquantum](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/crquantum/32/730_2.png) [@CRquantum](https://fortran-lang.discourse.group/u/CRquantum)\
**Post date:** [February 14, 2022, 2:32am UTC](https://fortran-lang.discourse.group/t/text-editors-or-ides-with-folding-of-fortran-include-statements/2779/3 "2022-02-14T02:32:26Z")

</div>

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.

 ![image](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/1/17eff0149c27a079f7be6f72675deac1fcab8cdb.png)

---

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [February 14, 2022, 11:13am UTC](https://fortran-lang.discourse.group/t/text-editors-or-ides-with-folding-of-fortran-include-statements/2779/4 "2022-02-14T11:13:15Z")

</div>

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:

```fortran
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”).
