We can put these longer listings in a file and include it directly from the file using 
```
\lstinputlisting[style=fromfile]{<filename>}
```