I am using listings with these settings:
\lstset{language=C++,basicstyle=\small\sffamily,
numbers=none,
frame=tb,
columns=fullflexible,
showstringspaces=false
}
I like the proportionally set font, but I want to be able to align comments of different lines. Is it possible to do some kind of tabbing with the lstlisting environment?
\begin{lstlisting}
float f; // A float
int anAptlyNamedInteger; // An integer
\end{lstlisting}
I would like the two comments to be aligned horizontally.


columns=fullflexible, which tellslistingsnot to even try to achieve any sort of column alignment. Perhaps it can be done by using the comment sequence//as an "escape", which exits the pseudocode syntax hilighting and admits TeX commands to be used. – Niel de Beaudrap Oct 12 '11 at 15:20