I agree that the default listings are not so attractive. I usually write something like
\ lstset {columns = fullflexible, basicstyle = \ ttfamily}
You may also need to play with the keys identifierstyle , commentstyle , etc., if the style for your code uses them separately.
The columns=fullflexible suppresses the listing, which makes the text with a proportional width fit into a monospaced grid; it is not necessary if you choose a monospace font to start with.
Will robertson
source share