I want to add a colon ":" after each lstlistingname in the lstlistoflistings.
At the moment the it shows me "Code 1 StatusCalculator Initialize....." But I want a colon after lstlistingname "Code 1: StatusCalculator Initialize..."
I didn't get it to run. Can anyone help me?
\documentclass[12pt, a4paper, oneside]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[ngerman]{babel}
\usepackage[hidelinks=true]{hyperref}
\usepackage[final]{pdfpages}
\definecolor{grey}{gray}{0.9}
\usepackage{listings}
\renewcommand\lstlistingname{Code}
\lstloadlanguages{Ruby}
\lstset{%
basicstyle=\small\ttfamily\color{black},
commentstyle = \ttfamily\color{red},
keywordstyle=\ttfamily\color{blue},
stringstyle=\color{orange},
backgroundcolor=\color{grey},
columns=fullflexible}
\usepackage{color}
\usepackage{xcolor}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\let\oldlstlistoflistings\lstlistoflistings
\renewcommand{\lstlistoflistings}{%
\begingroup%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\lstlistingname~\oldnumberline}%
\oldlstlistoflistings%
\endgroup}
\usepackage{geometry}
\geometry{a4paper, top=25mm, left=25mm, right=25mm, bottom=20mm, headsep=10mm, footskip=12mm}
\begin{document}
\renewcommand\lstlistlistingname{Codelisting}
\addcontentsline{toc}{section}{Codelisting}
\lstlistoflistings
\newpage
\begin{lstlisting}[language=Ruby, caption=StatusCalculator Initialize, label=initialize]
def initialize(project_id)
@project = Project.find(project_id)
end
\end{lstlisting}
\end{document}
