# Add word Listing in front of number in list of listings

I have to add the word Listing or Lst. in front of the number of a listings in the list-of-listings. I use the listings package. I know how to achieve this with tables:

\renewcommand{\cfttabpresnum}{Tab. }


but is there something similar for the listings?

My current code:

\documentclass[12pt,a4paper]{scrartcl}
\usepackage{listings}
\begin{document}
\lstlistoflistings
\section{Test}
\begin{lstlisting}[caption=TestListing]
test()
\end{lstlisting}
\end{document}

-

\documentclass[12pt,a4paper]{scrartcl}
\usepackage{listings}
\makeatletter
\def\l@lstlisting#1#2{\@dottedtocline{1}{0em}{1em}{Listing #1}{#2}}
\makeatother
\begin{document}
\lstlistoflistings
\section{Test}

\begin{lstlisting}[caption=TestListing]
test()
\end{lstlisting}
\end{document}

-
You were one minute faster. I was just typing the same answer, but was still wording some explanation text. :-) One suggestion: I would use {\lstlistingname\space#1} instead of {Listing #1} to keep it in sync if the listings name is ever changed, e.g. by babel. – Martin Scharrer Jul 7 '11 at 8:44