I am using t-vim module and I would like to format my listings similar to figures with captions, but with the ability to spread them over multiple pages. I can see three ways to do it:
- Put the \typeCfile{mycode.c} command inside a float object. The problem is that floats cannot be split over multiple pages.
- Type the listing as text and add a caption after it. However, my listings are sometimes split by figures and I did not find a way to prevent a float object from entering my listings.
- Put each line of code inside a row of an invisible table and make the table to be splitable. Unfortunately, I did not find a way to automatically create such a table out of my source file.
Is there any other solution or can one of my solutions be fixed?

\tcbuselibrary{listings, breakable}? – Erwann Mar 19 '21 at 09:27