Using minted, I'm typesetting listings that are longer than one page. However, using the listing environment that comes with minted does not work, because it does not break at the and of a page. I have found a possible solution by using captionof so it still appears in the list of listings.
However, after using it, the parskip is reset and the option half is not used anymore, for any text below it.
\documentclass[
12pt,
paper=a4,
parskip=half ]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{libertine}
\usepackage[libertine,cmintegrals,cmbraces,vvarbb]{newtxmath}
\usepackage{inconsolata}
\usepackage{minted}
\usepackage{caption}
\usepackage{lipsum}
\begin{document}
\lipsum
\begin{minted}{python}
def foo():
# Here would be code longer than one page
return 0
\end{minted}
\captionof{listing}{Some Text}
\lipsum
\end{document}

\usepackage{caption}from the code. – Jan 22 '15 at 13:51\captionofif you put it in a full answer instead of just commenting about it. – Manuel Jan 22 '15 at 13:54\addtokomafont{captionlabel}{\bfseries}? – Manuel Jan 22 '15 at 13:56\usepackage[labelfont=bf]{caption}. – ap0 Jan 22 '15 at 14:11captiondoesn't know all the features by KOMA and might break stuff. It's like understanding relativity, the special approach is the simplest, the more generic solution is a lot harder to get. – Johannes_B Jan 22 '15 at 14:28